Ejemplo n.º 1
0
 /**
  * @param AuthConfig       $config
  * @param FactoryInterface $factory
  * @return UserSourceInterface
  */
 public function userSource(AuthConfig $config, FactoryInterface $factory)
 {
     if (empty($config->userSource())) {
         throw new AuthException("User source is not set");
     }
     return $factory->make($config->userSource());
 }
Ejemplo n.º 2
0
 /**
  * @return UserSourceInterface
  */
 private function userSource()
 {
     if (empty($this->userSource)) {
         //Lazy loading
         $this->userSource = $this->factory->make($this->config->userSource());
     }
     return $this->userSource;
 }
Ejemplo n.º 3
0
 /**
  * @param string $name
  * @return ProviderInterface
  */
 public function getProvider($name)
 {
     return $this->factory->make($this->config->providerClass($name), $this->config->providerOptions($name));
 }
Ejemplo n.º 4
0
 /**
  * @param string $name
  * @return TokenOperatorInterface
  */
 public function getOperator($name)
 {
     return $this->factory->make($this->config->operatorClass($name), $this->config->operatorOptions($name));
 }