openid_memento_service = $openid_memento_service; $this->oauth2_memento_service = $oauth2_memento_service; $this->auth_service = $auth_service; $this->user_service = $user_service; $this->user_action_service = $user_action_service; $this->security_context_service = $security_context_service; } public function build():ILoginStrategy{ $res = null; Log::debug(sprintf("LoginStrategyFactory::build")); if ($this->openid_memento_service->exists()) { //openid stuff Log::debug(sprintf("LoginStrategyFactory::build OIDC")); return new OpenIdLoginStrategy ( $this->openid_memento_service, $this->user_action_service, $this->auth_service ); } else if ($this->oauth2_memento_service->exists()) { Log::debug(sprintf("LoginStrategyFactory::build OAUTH2")); return new OAuth2LoginStrategy ( $this->auth_service, $this->oauth2_memento_service, $this->user_action_service, $this->security_context_service ); } //default stuff Log::debug(sprintf("LoginStrategyFactory::build DEFAULT")); return new DefaultLoginStrategy($this->user_action_service, $this->auth_service); } }