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

public instantiate ( ) : object
Результат object
Пример #1
0
 /**
  * @param string $method
  * @param array  $arguments
  *
  * @return mixed
  */
 public function during($method, array $arguments = array())
 {
     if ($method === '__construct') {
         $this->subject->beAnInstanceOf($this->wrappedObject->getClassName(), $arguments);
         return $this->duringInstantiation();
     }
     $object = $this->wrappedObject->instantiate();
     return $this->runDuring($object, $method, $arguments);
 }
Пример #2
0
 /**
  * @param string $method
  * @param array  $arguments
  *
  * @return mixed
  */
 public function during($method, array $arguments = array())
 {
     if ($method === '__construct') {
         $this->subject->beAnInstanceOf($this->wrappedObject->getClassname(), $arguments);
         $instantiator = new Instantiator();
         $object = $instantiator->instantiate($this->wrappedObject->getClassname());
     } else {
         $object = $this->wrappedObject->instantiate();
     }
     return $this->runDuring($object, $method, $arguments);
 }