예제 #1
0
파일: Knot.php 프로젝트: oktopost/skeleton
 /**
  * @param mixed $instance
  * @return mixed Same instance always returned
  */
 public function loadInstance($instance)
 {
     $reflection = new \ReflectionClass($instance);
     while ($reflection) {
         if ($this->isAutoloadClass($reflection)) {
             $this->propertyConnector->connect($reflection, $instance);
             $this->methodConnector->connect($reflection, $instance);
         }
         $reflection = $reflection->getParentClass();
     }
     return $instance;
 }
예제 #2
0
 /**
  * @param MethodConnector $connector
  * @param string $type
  * @return mixed
  */
 private function invokeConnect(MethodConnector $connector, $type)
 {
     $instance = new $type();
     $connector->connect(new \ReflectionClass($type), $instance);
     return $instance;
 }