Example #1
0
 public function instantiate(Context $context, $nesting, $graph = null)
 {
     array_unshift($nesting, $this->class);
     $dependencies = $context->createDependencies($context->repository()->getConstructorParameters($this->class), $nesting, $graph);
     $instance = call_user_func_array(array(new \ReflectionClass($this->class), 'newInstance'), $dependencies);
     $context->invokeSetters($context, $nesting, $this->class, $instance, $graph);
     return $instance;
 }
Example #2
0
 function instantiate(Context $context, $nesting, $graph = null)
 {
     @session_start();
     if (!isset($_SESSION[$this->slot])) {
         array_unshift($nesting, $this->class);
         $dependencies = $context->createDependencies($context->repository()->getConstructorParameters($this->class), $nesting);
         $_SESSION[$this->slot] = call_user_func_array(array(new ReflectionClass($this->class), 'newInstance'), $dependencies);
     }
     return $_SESSION[$this->slot];
 }
Example #3
0
 /**
  * @return ClassRepository
  */
 function repository()
 {
     return $this->parent->repository();
 }