Eloquent\Phony\Mock\Method\AbstractWrappedMethod::__construct PHP Метод

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

Construct a new wrapped method.
public __construct ( ReflectionMethod $method, Eloquent\Phony\Mock\Handle\Handle $handle )
$method ReflectionMethod The method.
$handle Eloquent\Phony\Mock\Handle\Handle The handle.
    public function __construct(ReflectionMethod $method, Handle $handle)
    {
        $this->method = $method;
        $this->handle = $handle;
        $this->name = $method->getName();
        if ($handle instanceof StaticHandle) {
            $this->mock = null;
            $callback = array($method->getDeclaringClass()->getName(), $this->name);
        } else {
            $this->mock = $handle->get();
            $callback = array($this->mock, $this->name);
        }
        parent::__construct($callback, null);
    }

Usage Example

Пример #1
0
 /**
  * Construct a new wrapped custom method.
  *
  * @param callable         $customCallback The custom callback.
  * @param ReflectionMethod $method         The method.
  * @param Handle           $handle         The handle.
  * @param Invoker          $invoker        The invoker to use.
  */
 public function __construct($customCallback, ReflectionMethod $method, Handle $handle, Invoker $invoker)
 {
     $this->customCallback = $customCallback;
     $this->invoker = $invoker;
     parent::__construct($method, $handle);
 }
All Usage Examples Of Eloquent\Phony\Mock\Method\AbstractWrappedMethod::__construct