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

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

This method supports reference parameters.
public invokeWith ( Arguments | array $arguments = [] ) : mixed
$arguments Eloquent\Phony\Call\Arguments | array The arguments.
Результат mixed The result of invocation.
    public function invokeWith($arguments = array())
    {
        $this->closeRule();
        if (empty($this->rules)) {
            call_user_func($this->defaultAnswerCallback, $this);
            $this->closeRule();
        }
        if ($arguments instanceof Arguments) {
            $argumentsArray = $arguments->all();
        } else {
            $argumentsArray = $arguments;
            $arguments = new Arguments($arguments);
        }
        foreach ($this->rules as $rule) {
            if ($this->matcherVerifier->matches($rule->criteria(), $argumentsArray)) {
                break;
            }
        }
        $answer = $rule->next();
        foreach ($answer->secondaryRequests() as $request) {
            $this->invoker->callWith($request->callback(), $request->finalArguments($this->self, $arguments));
        }
        $request = $answer->primaryRequest();
        return $this->invoker->callWith($request->callback(), $request->finalArguments($this->self, $arguments));
    }