Loading src/BjyAuthorize/Service/BaseProvidersServiceFactory.php +3 −16 Original line number Diff line number Diff line Loading @@ -4,27 +4,15 @@ namespace BjyAuthorize\Service; use BjyAuthorize\Provider\Rule\ProviderInterface; use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; /** * Base factory responsible of instantiating providers * * @author Marco Pivetta <ocramius@gmail.com> */ abstract class BaseProvidersServiceFactory implements FactoryInterface abstract class BaseProvidersServiceFactory { const PROVIDER_SETTING = 'providers'; /** * {@inheritDoc} */ public function createService(ServiceLocatorInterface $serviceLocator) { return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) public function __invoke(ContainerInterface $container) { $config = $container->get('BjyAuthorize\Config'); $providers = array(); Loading @@ -32,8 +20,7 @@ abstract class BaseProvidersServiceFactory implements FactoryInterface foreach ($config[static::PROVIDER_SETTING] as $providerName => $providerConfig) { if ($container->has($providerName)) { $provider = $container->get($providerName); if (method_exists($provider, 'setConfig')) { // if ($provider instanceof ProviderInterface) { if ($provider instanceof ProviderInterface) { $provider->setConfig($providerConfig); $provider->processConfig(); } Loading Loading
src/BjyAuthorize/Service/BaseProvidersServiceFactory.php +3 −16 Original line number Diff line number Diff line Loading @@ -4,27 +4,15 @@ namespace BjyAuthorize\Service; use BjyAuthorize\Provider\Rule\ProviderInterface; use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; /** * Base factory responsible of instantiating providers * * @author Marco Pivetta <ocramius@gmail.com> */ abstract class BaseProvidersServiceFactory implements FactoryInterface abstract class BaseProvidersServiceFactory { const PROVIDER_SETTING = 'providers'; /** * {@inheritDoc} */ public function createService(ServiceLocatorInterface $serviceLocator) { return $this->__invoke($serviceLocator, '?'); } public function __invoke(ContainerInterface $container, $requestedName, array $options = null) public function __invoke(ContainerInterface $container) { $config = $container->get('BjyAuthorize\Config'); $providers = array(); Loading @@ -32,8 +20,7 @@ abstract class BaseProvidersServiceFactory implements FactoryInterface foreach ($config[static::PROVIDER_SETTING] as $providerName => $providerConfig) { if ($container->has($providerName)) { $provider = $container->get($providerName); if (method_exists($provider, 'setConfig')) { // if ($provider instanceof ProviderInterface) { if ($provider instanceof ProviderInterface) { $provider->setConfig($providerConfig); $provider->processConfig(); } Loading