PhpSpec\Wrapper\Subject\Caller::call PHP Метод

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

public call ( string $method, array $arguments = [] ) : Subject
$method string
$arguments array
Результат PhpSpec\Wrapper\Subject
    public function call($method, array $arguments = array())
    {
        if (null === $this->getWrappedObject()) {
            throw $this->callingMethodOnNonObject($method);
        }
        $subject = $this->wrappedObject->getInstance();
        $unwrapper = new Unwrapper();
        $arguments = $unwrapper->unwrapAll($arguments);
        if ($this->isObjectMethodCallable($method)) {
            return $this->invokeAndWrapMethodResult($subject, $method, $arguments);
        }
        throw $this->methodNotFound($method, $arguments);
    }

Usage Example

Пример #1
0
 /**
  * @return Subject
  */
 public function __invoke()
 {
     return $this->caller->call('__invoke', func_get_args());
 }