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