PhpSpec\Wrapper\Subject\WrappedObject::getFactoryMethod PHP Method

getFactoryMethod() public method

public getFactoryMethod ( ) : callable | null
return callable | null
    public function getFactoryMethod()
    {
        return $this->factoryMethod;
    }

Usage Example

Esempio n. 1
0
 /**
  * @return mixed
  */
 public function duringInstantiation()
 {
     if ($factoryMethod = $this->wrappedObject->getFactoryMethod()) {
         $method = is_array($factoryMethod) ? $factoryMethod[1] : $factoryMethod;
     } else {
         $method = '__construct';
     }
     $instantiator = new Instantiator();
     $object = $instantiator->instantiate($this->wrappedObject->getClassName());
     return $this->runDuring($object, $method, $this->wrappedObject->getArguments());
 }
All Usage Examples Of PhpSpec\Wrapper\Subject\WrappedObject::getFactoryMethod