/** * @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; }
/** * @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; } } } } }
/** * @return null */ public function init() { parent::init(); $this->annotReader = new SimpleAnnotationReader(); $this->annotReader->addNamespace(__NAMESPACE__ . '\\Annotation\\Action'); $this->annotReader->addNamespace(__NAMESPACE__ . '\\Annotation\\Common'); }
/** * @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); } }
public function __construct() { parent::__construct(); }
public function __construct(Helper $helper = null) { parent::__construct(); $this->viewHelper = $helper; }
/** * */ public function __construct(Metadriver $metadriver) { parent::__construct(); $this->metadriver = $metadriver; }