[feature/oauth] Clean up unneeded complexity

PHPBB3-11673
This commit is contained in:
Joseph Warner 2013-07-18 21:03:57 -04:00
parent f852485513
commit 4c48da0597

View file

@ -67,13 +67,6 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
*/ */
protected $auth_provider_oauth_token_account_assoc; protected $auth_provider_oauth_token_account_assoc;
/**
* Cached services once they has been created
*
* @var array Contains \OAuth\Common\Service\ServiceInterface or null
*/
protected $services;
/** /**
* All OAuth service providers * All OAuth service providers
* *
@ -108,7 +101,6 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
$this->auth_provider_oauth_token_storage_table = $auth_provider_oauth_token_storage_table; $this->auth_provider_oauth_token_storage_table = $auth_provider_oauth_token_storage_table;
$this->auth_provider_oauth_token_account_assoc = $auth_provider_oauth_token_account_assoc; $this->auth_provider_oauth_token_account_assoc = $auth_provider_oauth_token_account_assoc;
$this->service_providers = $service_providers; $this->service_providers = $service_providers;
$this->services = array();
} }
/** /**
@ -226,11 +218,6 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
*/ */
protected function get_service($service_name, phpbb_auth_oauth_token_storage $storage, array $service_credentials, array $scopes = array()) protected function get_service($service_name, phpbb_auth_oauth_token_storage $storage, array $service_credentials, array $scopes = array())
{ {
if ($this->services[$service_name])
{
return $this->services[$service_name];
}
$current_uri = $this->get_current_uri(); $current_uri = $this->get_current_uri();
// Setup the credentials for the requests // Setup the credentials for the requests
@ -241,8 +228,6 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
); );
$service_factory = new \OAuth\ServiceFactory(); $service_factory = new \OAuth\ServiceFactory();
$this->service[$service_name] = $service_factory->createService($service_name, $credentials, $storage, $scopes); return $service_factory->createService($service_name, $credentials, $storage, $scopes);
return $this->service[$service_name];
} }
} }