Exemplo n.º 1
0
 /**
  * @return array
  */
 public function getInjectorDeps(\ReflectionMethod $injector)
 {
     $result = [];
     foreach ($injector->getParameters() as $param) {
         $typeHinted = $param->getClass();
         if (!$typeHinted) {
             $result[] = null;
             continue;
         }
         $typeName = $typeHinted->name;
         $depClassName = null;
         if ($typeHinted->isInterface()) {
             $metaService = $this->metadriver->getMetaServiceByInterface($typeName);
             // some services can be optional. deactivate service if current event
             // is not in the list of its wake-up events
             if ($param->isOptional()) {
                 $this->deactivateService($metaService);
             }
             $depClassName = $metaService->getActiveFlag() ? $metaService->getClassName() : null;
         } else {
             if (AbstractService::isService($typeName)) {
                 $depClassName = $typeName;
             }
         }
         $result[] = $depClassName;
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * @return string
  */
 public function classNameTo_URI($className)
 {
     if (AbstractService::isSubclass($className)) {
         return $this->toService_URI($className);
     } else {
         if (MVC\Controller\Action\AbstractAction::isSubclass($className)) {
             return $this->toAction_URI($className);
         } else {
             if (MVC\Controller\AbstractController::isSubclass($className)) {
                 return $this->toController_URI($className);
             } else {
                 if (MVC\Controller\AbstractFrontController::isSubclass($className)) {
                     return $this->toFrontController_URI($className);
                 } else {
                     return null;
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 /**
  * @return null
  */
 public function init()
 {
     parent::init();
     $this->annotReader = new SimpleAnnotationReader();
     $this->annotReader->addNamespace(__NAMESPACE__ . '\\Annotation\\Action');
     $this->annotReader->addNamespace(__NAMESPACE__ . '\\Annotation\\Common');
 }
Exemplo n.º 4
0
 /**
  * @return object
  */
 public function create($className, $factoryArgs = [])
 {
     $fqcn = $this->nameResolver->resolve($className);
     if (AbstractService::isService($fqcn)) {
         return $this->createService($fqcn, $factoryArgs);
     } else {
         return $this->createObject($fqcn, $factoryArgs);
     }
 }
Exemplo n.º 5
0
 public function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 6
0
 public function __construct(Helper $helper = null)
 {
     parent::__construct();
     $this->viewHelper = $helper;
 }
Exemplo n.º 7
0
 /**
  * 
  */
 public function __construct(Metadriver $metadriver)
 {
     parent::__construct();
     $this->metadriver = $metadriver;
 }