diff options
Diffstat (limited to 'phpBB/phpbb/auth/provider/oauth/service')
-rw-r--r-- | phpBB/phpbb/auth/provider/oauth/service/base.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/auth/provider/oauth/service/bitly.php | 18 | ||||
-rw-r--r-- | phpBB/phpbb/auth/provider/oauth/service/facebook.php | 18 | ||||
-rw-r--r-- | phpBB/phpbb/auth/provider/oauth/service/google.php | 18 | ||||
-rw-r--r-- | phpBB/phpbb/auth/provider/oauth/service/service_interface.php (renamed from phpBB/phpbb/auth/provider/oauth/service/interface.php) | 8 |
5 files changed, 38 insertions, 28 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/service/base.php b/phpBB/phpbb/auth/provider/oauth/service/base.php index 1eb49b4265..61deb48695 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/base.php +++ b/phpBB/phpbb/auth/provider/oauth/service/base.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider\oauth\service; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * * @package auth */ -abstract class phpbb_auth_provider_oauth_service_base implements phpbb_auth_provider_oauth_service_interface +abstract class base implements \phpbb\auth\provider\oauth\service\service_interface { /** * External OAuth service provider diff --git a/phpBB/phpbb/auth/provider/oauth/service/bitly.php b/phpBB/phpbb/auth/provider/oauth/service/bitly.php index 3bafdd59ce..47cf7ee380 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/bitly.php +++ b/phpBB/phpbb/auth/provider/oauth/service/bitly.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider\oauth\service; + /** * @ignore */ @@ -20,29 +22,29 @@ if (!defined('IN_PHPBB')) * * @package auth */ -class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_service_base +class bitly extends \phpbb\auth\provider\oauth\service\base { /** * phpBB config * - * @var phpbb_config + * @var \phpbb\config\config */ protected $config; /** * phpBB request * - * @var phpbb_request + * @var \phpbb\request\request_interface */ protected $request; /** * Constructor * - * @param phpbb_config $config - * @param phpbb_request $request + * @param \phpbb\config\config $config + * @param \phpbb\request\request_interface $request */ - public function __construct(phpbb_config $config, phpbb_request $request) + public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request) { $this->config = $config; $this->request = $request; @@ -66,7 +68,7 @@ class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_ { if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly)) { - throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); } // This was a callback request from bitly, get the token @@ -86,7 +88,7 @@ class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_ { if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly)) { - throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); } // Send a request with it diff --git a/phpBB/phpbb/auth/provider/oauth/service/facebook.php b/phpBB/phpbb/auth/provider/oauth/service/facebook.php index 49206b7654..4a4eeba6d5 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/facebook.php +++ b/phpBB/phpbb/auth/provider/oauth/service/facebook.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider\oauth\service; + /** * @ignore */ @@ -20,29 +22,29 @@ if (!defined('IN_PHPBB')) * * @package auth */ -class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oauth_service_base +class facebook extends base { /** * phpBB config * - * @var phpbb_config + * @var phpbb\config\config */ protected $config; /** * phpBB request * - * @var phpbb_request + * @var phpbb\request\request_interface */ protected $request; /** * Constructor * - * @param phpbb_config $config - * @param phpbb_request $request + * @param phpbb\config\config $config + * @param phpbb\request\request_interface $request */ - public function __construct(phpbb_config $config, phpbb_request $request) + public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request) { $this->config = $config; $this->request = $request; @@ -66,7 +68,7 @@ class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oau { if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook)) { - throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); } // This was a callback request, get the token @@ -86,7 +88,7 @@ class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oau { if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook)) { - throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); } // Send a request with it diff --git a/phpBB/phpbb/auth/provider/oauth/service/google.php b/phpBB/phpbb/auth/provider/oauth/service/google.php index d4ef6e1d42..2449bbf523 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/google.php +++ b/phpBB/phpbb/auth/provider/oauth/service/google.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider\oauth\service; + /** * @ignore */ @@ -20,29 +22,29 @@ if (!defined('IN_PHPBB')) * * @package auth */ -class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth_service_base +class google extends base { /** * phpBB config * - * @var phpbb_config + * @var phpbb\config\config */ protected $config; /** * phpBB request * - * @var phpbb_request + * @var phpbb\request\request_interface */ protected $request; /** * Constructor * - * @param phpbb_config $config - * @param phpbb_request $request + * @param phpbb\config\config $config + * @param phpbb\request\request_interface $request */ - public function __construct(phpbb_config $config, phpbb_request $request) + public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request) { $this->config = $config; $this->request = $request; @@ -77,7 +79,7 @@ class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth { if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google)) { - throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); } // This was a callback request, get the token @@ -97,7 +99,7 @@ class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth { if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google)) { - throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); + throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); } // Send a request with it diff --git a/phpBB/phpbb/auth/provider/oauth/service/interface.php b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php index 3bba7c0e2c..ab69fe6ef3 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/interface.php +++ b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider\oauth\service; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * * @package auth */ -interface phpbb_auth_provider_oauth_service_interface +interface service_interface { /** * Returns an array of the scopes necessary for auth @@ -52,7 +54,7 @@ interface phpbb_auth_provider_oauth_service_interface /** * Returns the results of the authentication in json format * - * @throws phpbb_auth_provider_oauth_service_exception + * @throws \phpbb\auth\provider\oauth\service\exception * @return string The unique identifier returned by the service provider * that is used to authenticate the user with phpBB. */ @@ -62,7 +64,7 @@ interface phpbb_auth_provider_oauth_service_interface * Returns the results of the authentication in json format * Use this function when the user already has an access token * - * @throws phpbb_auth_provider_oauth_service_exception + * @throws \phpbb\auth\provider\oauth\service\exception * @return string The unique identifier returned by the service provider * that is used to authenticate the user with phpBB. */ |