instantiate() public method

public instantiate ( ) : object
return object
Example #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);
 }
Example #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);
 }