Пример #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());
 }
Пример #2
0
 /**
  * @return UserSourceInterface
  */
 private function userSource()
 {
     if (empty($this->userSource)) {
         //Lazy loading
         $this->userSource = $this->factory->make($this->config->userSource());
     }
     return $this->userSource;
 }
Пример #3
0
 /**
  * @param string $name
  * @return ProviderInterface
  */
 public function getProvider($name)
 {
     return $this->factory->make($this->config->providerClass($name), $this->config->providerOptions($name));
 }
Пример #4
0
 /**
  * @param string $name
  * @return TokenOperatorInterface
  */
 public function getOperator($name)
 {
     return $this->factory->make($this->config->operatorClass($name), $this->config->operatorOptions($name));
 }