Skip to content

Commit

Permalink
code standard fixes:
Browse files Browse the repository at this point in the history
- namespaces and whitespace
- fixes phpdoc blocks
  • Loading branch information
bshaffer committed Jul 8, 2014
1 parent 3c759da commit 24e9d88
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 196 deletions.
18 changes: 8 additions & 10 deletions src/OAuth2/ClientAssertionType/HttpBasic.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ class HttpBasic implements ClientAssertionTypeInterface
protected $config;

/**
* @param OAuth2\Storage\ClientCredentialsInterface $clientStorage
* REQUIRED Storage class for retrieving client credentials information
* @param array $config
* OPTIONAL Configuration options for the server
* @code
* $config = array(
* 'allow_credentials_in_request_body' => true, // whether to look for credentials in the POST body in addition to the Authorize HTTP Header
* 'allow_public_clients' => true // if true, "public clients" (clients without a secret) may be authenticated
* );
* @endcode
* @param OAuth2\Storage\ClientCredentialsInterface $clientStorage REQUIRED Storage class for retrieving client credentials information
* @param array $config OPTIONAL Configuration options for the server
* <code>
* $config = array(
* 'allow_credentials_in_request_body' => true, // whether to look for credentials in the POST body in addition to the Authorize HTTP Header
* 'allow_public_clients' => true // if true, "public clients" (clients without a secret) may be authenticated
* );
* </code>
*/
public function __construct(ClientCredentialsInterface $storage, array $config = array())
{
Expand Down
44 changes: 18 additions & 26 deletions src/OAuth2/Controller/AuthorizeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,19 @@ class AuthorizeController implements AuthorizeControllerInterface
protected $scopeUtil;

/**
* @param OAuth2\Storage\ClientInterface $clientStorage
* REQUIRED Instance of OAuth2\Storage\ClientInterface to retrieve client information
* @param array $responseTypes
* OPTIONAL Array of OAuth2\ResponseType\ResponseTypeInterface objects. Valid array
* keys are "code" and "token"
* @param array $config
* OPTIONAL Configuration options for the server
* @code
* $config = array(
* 'allow_implicit' => false, // if the controller should allow the "implicit" grant type
* 'enforce_state' => true // if the controller should require the "state" parameter
* 'require_exact_redirect_uri' => true, // if the controller should require an exact match on the "redirect_uri" parameter
* 'redirect_status_code' => 302, // HTTP status code to use for redirect responses
* );
* @endcode
* @param OAuth2\ScopeInterface $scopeUtil
* OPTIONAL Instance of OAuth2\ScopeInterface to validate the requested scope
* @param OAuth2\Storage\ClientInterface $clientStorage REQUIRED Instance of OAuth2\Storage\ClientInterface to retrieve client information
* @param array $responseTypes OPTIONAL Array of OAuth2\ResponseType\ResponseTypeInterface objects. Valid array
* keys are "code" and "token"
* @param array $config OPTIONAL Configuration options for the server
* <code>
* $config = array(
* 'allow_implicit' => false, // if the controller should allow the "implicit" grant type
* 'enforce_state' => true // if the controller should require the "state" parameter
* 'require_exact_redirect_uri' => true, // if the controller should require an exact match on the "redirect_uri" parameter
* 'redirect_status_code' => 302, // HTTP status code to use for redirect responses
* );
* </code>
* @param OAuth2\ScopeInterface $scopeUtil OPTIONAL Instance of OAuth2\ScopeInterface to validate the requested scope
*/
public function __construct(ClientInterface $clientStorage, array $responseTypes = array(), array $config = array(), ScopeInterface $scopeUtil = null)
{
Expand Down Expand Up @@ -271,10 +267,8 @@ public function validateAuthorizeRequest(RequestInterface $request, ResponseInte
/**
* Build the absolute URI based on supplied URI and parameters.
*
* @param $uri
* An absolute URI.
* @param $params
* Parameters to be append as GET.
* @param $uri An absolute URI.
* @param $params Parameters to be append as GET.
*
* @return
* An absolute URI with supplied parameters.
Expand Down Expand Up @@ -318,11 +312,9 @@ protected function getValidResponseTypes()
/**
* Internal method for validating redirect URI supplied
*
* @param string $inputUri
* The submitted URI to be validated
* @param string $registeredUriString
* The allowed URI(s) to validate against. Can be a space-delimited string of URIs to
* allow for multiple URIs
* @param string $inputUri The submitted URI to be validated
* @param string $registeredUriString The allowed URI(s) to validate against. Can be a space-delimited string of URIs to
* allow for multiple URIs
*
* @see http://tools.ietf.org/html/rfc6749#section-3.1.2
*/
Expand Down
3 changes: 1 addition & 2 deletions src/OAuth2/GrantType/AuthorizationCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class AuthorizationCode implements GrantTypeInterface
protected $authCode;

/**
* @param OAuth2\Storage\AuthorizationCodeInterface $storage
* REQUIRED Storage class for retrieving authorization code information
* @param OAuth2\Storage\AuthorizationCodeInterface $storage REQUIRED Storage class for retrieving authorization code information
*/
public function __construct(AuthorizationCodeInterface $storage)
{
Expand Down
9 changes: 3 additions & 6 deletions src/OAuth2/GrantType/JwtBearer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ class JwtBearer implements GrantTypeInterface, ClientAssertionTypeInterface
/**
* Creates an instance of the JWT bearer grant type.
*
* @param OAuth2\Storage\JWTBearerInterface $storage
* A valid storage interface that implements storage hooks for the JWT bearer grant type.
* @param string $audience
* The audience to validate the token against. This is usually the full URI of the OAuth token requests endpoint.
* @param OAuth2\Encryption\JWT OPTIONAL $jwtUtil
* The class used to decode, encode and verify JWTs.
* @param OAuth2\Storage\JWTBearerInterface $storage A valid storage interface that implements storage hooks for the JWT bearer grant type.
* @param string $audience The audience to validate the token against. This is usually the full URI of the OAuth token requests endpoint.
* @param OAuth2\Encryption\JWT $jwtUtil OPTONAL The class used to decode, encode and verify JWTs.
*/
public function __construct(JwtBearerInterface $storage, $audience, EncryptionInterface $jwtUtil = null)
{
Expand Down
16 changes: 7 additions & 9 deletions src/OAuth2/GrantType/RefreshToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ class RefreshToken implements GrantTypeInterface
protected $config;

/**
* @param OAuth2\Storage\RefreshTokenInterface $storage
* REQUIRED Storage class for retrieving refresh token information
* @param array $config
* OPTIONAL Configuration options for the server
* @code
* $config = array(
* 'always_issue_new_refresh_token' => true, // whether to issue a new refresh token upon successful token request
* );
* @endcode
* @param OAuth2\Storage\RefreshTokenInterface $storage REQUIRED Storage class for retrieving refresh token information
* @param array $config OPTIONAL Configuration options for the server
* <code>
* $config = array(
* 'always_issue_new_refresh_token' => true, // whether to issue a new refresh token upon successful token request
* );
* </code>
*/
public function __construct(RefreshTokenInterface $storage, $config = array())
{
Expand Down
3 changes: 1 addition & 2 deletions src/OAuth2/GrantType/UserCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class UserCredentials implements GrantTypeInterface
protected $storage;

/**
* @param OAuth2\Storage\UserCredentialsInterface $storage
* REQUIRED Storage class for retrieving user credentials information
* @param OAuth2\Storage\UserCredentialsInterface $storage REQUIRED Storage class for retrieving user credentials information
*/
public function __construct(UserCredentialsInterface $storage)
{
Expand Down
17 changes: 6 additions & 11 deletions src/OAuth2/OpenID/ResponseType/AuthorizationCodeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ interface AuthorizationCodeInterface extends BaseAuthorizationCodeInterface
/**
* Handle the creation of the authorization code.
*
* @param $client_id
* Client identifier related to the authorization code
* @param $user_id
* User ID associated with the authorization code
* @param $redirect_uri
* An absolute URI to which the authorization server will redirect the
* user-agent to when the end-user authorization step is completed.
* @param $scope
* (optional) Scopes to be stored in space-separated string.
* @param $id_token
* (optional) The OpenID Connect id_token.
* @param $client_id Client identifier related to the authorization code
* @param $user_id User ID associated with the authorization code
* @param $redirect_uri An absolute URI to which the authorization server will redirect the
* user-agent to when the end-user authorization step is completed.
* @param $scope OPTIONAL Scopes to be stored in space-separated string.
* @param $id_token OPTIONAL The OpenID Connect id_token.
*
* @see http://tools.ietf.org/html/rfc6749#section-4
* @ingroup oauth2_section_4
Expand Down
8 changes: 4 additions & 4 deletions src/OAuth2/OpenID/ResponseType/IdTokenInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ interface IdTokenInterface extends ResponseTypeInterface
* If the Implicit Flow is used, the token and id_token are generated and
* returned together.
*
* @param string $client_id The client id.
* @param string $user_id The user id.
* @param string $nonce OPTIONAL The nonce.
* @param string $userClaims OPTIONAL Claims about the user.
* @param string $client_id The client id.
* @param string $user_id The user id.
* @param string $nonce OPTIONAL The nonce.
* @param string $userClaims OPTIONAL Claims about the user.
* @param string $access_token OPTIONAL The access token, if known.
*
* @return string The ID Token represented as a JSON Web Token (JWT).
Expand Down
21 changes: 7 additions & 14 deletions src/OAuth2/OpenID/Storage/AuthorizationCodeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,13 @@ interface AuthorizationCodeInterface extends BaseAuthorizationCodeInterface
*
* Required for OAuth2::GRANT_TYPE_AUTH_CODE.
*
* @param $code
* Authorization code to be stored.
* @param $client_id
* Client identifier to be stored.
* @param $user_id
* User identifier to be stored.
* @param string $redirect_uri
* Redirect URI(s) to be stored in a space-separated string.
* @param int $expires
* Expiration to be stored as a Unix timestamp.
* @param string $scope
* (optional) Scopes to be stored in space-separated string.
* @param string $id_token
* (optional) The OpenID Connect id_token.
* @param $code authorization code to be stored.
* @param $client_id client identifier to be stored.
* @param $user_id user identifier to be stored.
* @param string $redirect_uri redirect URI(s) to be stored in a space-separated string.
* @param int $expires expiration to be stored as a Unix timestamp.
* @param string $scope OPTIONAL scopes to be stored in space-separated string.
* @param string $id_token OPTIONAL the OpenID Connect id_token.
*
* @ingroup oauth2_section_4
*/
Expand Down
35 changes: 14 additions & 21 deletions src/OAuth2/ResponseType/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ class AccessToken implements AccessTokenInterface
protected $config;

/**
* @param OAuth2\Storage\AccessTokenInterface $tokenStorage
* REQUIRED Storage class for saving access token information
* @param OAuth2\Storage\RefreshTokenInterface $refreshStorage
* OPTIONAL Storage class for saving refresh token information
* @param array $config
* OPTIONAL Configuration options for the server
* @code
* $config = array(
* 'token_type' => 'bearer', // token type identifier
* 'access_lifetime' => 3600, // time before access token expires
* 'refresh_token_lifetime' => 1209600, // time before refresh token expires
* );
* @endcode
* @param OAuth2\Storage\AccessTokenInterface $tokenStorage REQUIRED Storage class for saving access token information
* @param OAuth2\Storage\RefreshTokenInterface $refreshStorage OPTIONAL Storage class for saving refresh token information
* @param array $config OPTIONAL Configuration options for the server
* <code>
* $config = array(
* 'token_type' => 'bearer', // token type identifier
* 'access_lifetime' => 3600, // time before access token expires
* 'refresh_token_lifetime' => 1209600, // time before refresh token expires
* );
* </endcode>
*/
public function __construct(AccessTokenStorageInterface $tokenStorage, RefreshTokenInterface $refreshStorage = null, array $config = array())
{
Expand Down Expand Up @@ -67,14 +64,10 @@ public function getAuthorizeResponse($params, $user_id = null)
/**
* Handle the creation of access token, also issue refresh token if supported / desirable.
*
* @param $client_id
* Client identifier related to the access token.
* @param $user_id
* User ID associated with the access token
* @param $scope
* (optional) Scopes to be stored in space-separated string.
* @param bool $includeRefreshToken
* If true, a new refresh_token will be added to the response
* @param $client_id client identifier related to the access token.
* @param $user_id user ID associated with the access token
* @param $scope OPTIONAL scopes to be stored in space-separated string.
* @param bool $includeRefreshToken if true, a new refresh_token will be added to the response
*
* @see http://tools.ietf.org/html/rfc6749#section-5
* @ingroup oauth2_section_5
Expand Down
12 changes: 4 additions & 8 deletions src/OAuth2/ResponseType/AccessTokenInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@ interface AccessTokenInterface extends ResponseTypeInterface
/**
* Handle the creation of access token, also issue refresh token if supported / desirable.
*
* @param $client_id
* Client identifier related to the access token.
* @param $user_id
* User ID associated with the access token
* @param $scope
* (optional) Scopes to be stored in space-separated string.
* @param bool $includeRefreshToken
* If true, a new refresh_token will be added to the response
* @param $client_id client identifier related to the access token.
* @param $user_id user ID associated with the access token
* @param $scope OPTONAL scopes to be stored in space-separated string.
* @param bool $includeRefreshToken if true, a new refresh_token will be added to the response
*
* @see http://tools.ietf.org/html/rfc6749#section-5
* @ingroup oauth2_section_5
Expand Down
14 changes: 5 additions & 9 deletions src/OAuth2/ResponseType/AuthorizationCodeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ public function enforceRedirect();
/**
* Handle the creation of the authorization code.
*
* @param $client_id
* Client identifier related to the authorization code
* @param $user_id
* User ID associated with the authorization code
* @param $redirect_uri
* An absolute URI to which the authorization server will redirect the
* user-agent to when the end-user authorization step is completed.
* @param $scope
* (optional) Scopes to be stored in space-separated string.
* @param $client_id client identifier related to the authorization code
* @param $user_id user id associated with the authorization code
* @param $redirect_uri an absolute URI to which the authorization server will redirect the
* user-agent to when the end-user authorization step is completed.
* @param $scope OPTIONAL scopes to be stored in space-separated string.
*
* @see http://tools.ietf.org/html/rfc6749#section-4
* @ingroup oauth2_section_4
Expand Down
2 changes: 1 addition & 1 deletion src/OAuth2/ResponseType/CryptoToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(PublicKeyInterface $publicKeyStorage = null, AccessT
* @param $scope
* (optional) Scopes to be stored in space-separated string.
* @param bool $includeRefreshToken
* If true, a new refresh_token will be added to the response
* If true, a new refresh_token will be added to the response
*
* @see http://tools.ietf.org/html/rfc6749#section-5
* @ingroup oauth2_section_5
Expand Down
Loading

0 comments on commit 24e9d88

Please sign in to comment.