예제 #1
0
 public function bootstrap()
 {
     $that = new ClassReflector($this);
     foreach ($that->getMethods() as $method) {
         if ($this->isValidMethod($method)) {
             $method->invoke($this);
         }
     }
     return $this;
 }
예제 #2
0
 public function __invoke()
 {
     $that = new ClassReflector($this);
     foreach ($that->getMethods() as $method) {
         if ($this->isValidMethod($method)) {
             $method->invokeArgs($this, func_get_args());
         }
     }
     return $this;
 }
예제 #3
0
 public function getIterator()
 {
     $class = new ClassReflector($this);
     $this->methods = new ArrayIterator();
     foreach ($class->getMethods() as $method) {
         if ($method->isInherited() || $method->isMagic()) {
             continue;
         }
         $this->methods[$method->getName()] = $method->getClosure($this);
     }
     return $this->methods;
 }
예제 #4
0
 public function configure(ContainerInterface $container)
 {
     $class = new ClassReflector($this);
     foreach ($class->getMethods() as $method) {
         if ($this->isValidMethod($method)) {
             $this->applyAliases($container, $method);
             $this->applyDependencies($container, $method);
             $this->applyTransient($container, $method);
             $this->applyTypes($container, $method);
             $container->set($method->getName(), $method->getClosure($this));
         }
     }
     return $this;
 }
 public function __invoke(ContainerInterface $container)
 {
     $class = new Reflection\ClassReflector($this);
     foreach ($class->getMethods() as $method) {
         if ($this->isValidMethod($method)) {
             $this->applyAliases($container, $method);
             $this->applyTransient($container, $method);
             $this->applyTypes($container, $method);
             $container->register($method->getName(), $method->getClosure($this));
         }
     }
     if (method_exists($this, self::METHOD_INIT)) {
         $this->{self::METHOD_INIT}($container);
     }
     return $this;
 }