public function create() { $translator = new TranslatorService($this->getCurrentLocale(), $this->getCacheFolder(), $this->config->get('debug', false)); $providers = $this->container->getByInterface(TranslationProviderInterface::class); foreach ($providers as $provider) { /* @var $provider TranslationProviderInterface */ $provider->configure($translator, $this->container); } return $translator; }
/** * @param mixed $type * @return SecurityProviderInterface */ private function getSecurityHandler($type) { $providers = $this->container->getByInterface(SecurityProviderInterface::class); foreach ($providers as $provider) { /* @var $provider SecurityProviderInterface */ if ($provider->getHandlerType() === $type) { return $provider; } } /* @var $logger LoggerInterface */ $logger = $this->container->get(LoggerInterface::class); $logger->warning("The requested security provides was" . " not met! Check your services", ['type' => $type]); return null; }