Eloquent\Phony\Stub\StubData::callsArgumentWith PHP Метод

callsArgumentWith() публичный Метод

Negative indices are offset from the end of the list. That is, -1 indicates the last element, and -2 indicates the second last element. Note that all supplied callbacks will be called in the same invocation.
public callsArgumentWith ( integer $index, Arguments | array $arguments = [], boolean $prefixSelf = false, boolean $suffixArgumentsObject = false, boolean $suffixArguments = false )
$index integer The argument index.
$arguments Eloquent\Phony\Call\Arguments | array The arguments.
$prefixSelf boolean True if the self value should be prefixed.
$suffixArgumentsObject boolean True if the arguments object should be appended.
$suffixArguments boolean True if the arguments should be appended individually.
    public function callsArgumentWith($index = 0, $arguments = array(), $prefixSelf = false, $suffixArgumentsObject = false, $suffixArguments = false)
    {
        $invoker = $this->invoker;
        if (!$arguments instanceof Arguments) {
            $arguments = new Arguments($arguments);
        }
        return $this->callsWith(function ($self, $incoming) use($invoker, $index, $arguments, $prefixSelf, $suffixArgumentsObject, $suffixArguments) {
            $callback = $incoming->get($index);
            $request = new CallRequest($callback, $arguments, $prefixSelf, $suffixArgumentsObject, $suffixArguments);
            $finalArguments = $request->finalArguments($self, $incoming);
            return $invoker->callWith($callback, $finalArguments);
        }, array(), true, true, false);
    }