示例#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;
 }