public function bootstrap()
 {
     $that = new ClassReflector($this);
     foreach ($that->getMethods() as $method) {
         if ($this->isValidMethod($method)) {
             $method->invoke($this);
         }
     }
     return $this;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
 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;
 }