Commit 0ff00304 authored by jcnventura's avatar jcnventura Committed by Joao Ventura
Browse files

Replace method doc blocks with {@inheritdoc}, and document the error returns...

Replace method doc blocks with {@inheritdoc}, and document the error returns in the client interface
parent 03edef2c
......@@ -10,5 +10,7 @@
"issues": "https://www.drupal.org/project/issues/openid_connect",
"source": "https://git.drupalcode.org/project/openid_connect"
},
"require": {}
"require": {
"ext-json": "*"
}
}
......@@ -194,11 +194,9 @@ class OpenIDConnect {
* identify the user.
*
* @param array $user_data
* The user data as returned from
* OpenIDConnectClientInterface::decodeIdToken().
* The user data from OpenIDConnectClientInterface::decodeIdToken().
* @param array $userinfo
* The user claims as returned from
* OpenIDConnectClientInterface::retrieveUserInfo().
* The user claims from OpenIDConnectClientInterface::retrieveUserInfo().
*
* @return string|false
* The sub, or FALSE if there was an error.
......
......@@ -227,13 +227,7 @@ abstract class OpenIDConnectClientBase extends PluginBase implements OpenIDConne
}
/**
* Implements OpenIDConnectClientInterface::authorize().
*
* @param string $scope
* A string of scopes.
*
* @return \Drupal\Core\Routing\TrustedRedirectResponse
* A trusted redirect response object.
* {@inheritdoc}
*/
public function authorize($scope = 'openid email') {
$redirect_uri = $this->getRedirectUrl()->toString(TRUE);
......@@ -277,13 +271,7 @@ abstract class OpenIDConnectClientBase extends PluginBase implements OpenIDConne
}
/**
* Implements OpenIDConnectClientInterface::retrieveIDToken().
*
* @param string $authorization_code
* A authorization code string.
*
* @return array|bool
* A result array or false.
* {@inheritdoc}
*/
public function retrieveTokens($authorization_code) {
// Exchange `code` for access token and ID token.
......@@ -333,7 +321,7 @@ abstract class OpenIDConnectClientBase extends PluginBase implements OpenIDConne
}
/**
* Implements OpenIDConnectClientInterface::decodeIdToken().
* {@inheritdoc}
*/
public function decodeIdToken($id_token) {
/* @noinspection PhpUnusedLocalVariableInspection */
......@@ -344,13 +332,7 @@ abstract class OpenIDConnectClientBase extends PluginBase implements OpenIDConne
}
/**
* Implements OpenIDConnectClientInterface::retrieveUserInfo().
*
* @param string $access_token
* An access token string.
*
* @return array|bool
* A result array or false.
* {@inheritdoc}
*/
public function retrieveUserInfo($access_token) {
$request_options = [
......
......@@ -53,12 +53,13 @@ interface OpenIDConnectClientInterface extends ConfigurableInterface, DependentP
* @param string $authorization_code
* Authorization code received as a result of the the authorization request.
*
* @return array
* @return array|bool
* An associative array containing:
* - id_token: The ID token that holds user data.
* - access_token: Access token that can be used to obtain user profile
* information.
* - expire: Unix timestamp of the expiration date of the access token.
* Or FALSE if tokens could not be retrieved.
*/
public function retrieveTokens($authorization_code);
......@@ -79,8 +80,8 @@ interface OpenIDConnectClientInterface extends ConfigurableInterface, DependentP
* @param string $access_token
* Access token.
*
* @return array
* User profile information.
* @return array|bool
* User profile information array, or FALSE if retrieval failed.
*/
public function retrieveUserInfo($access_token);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment