Applied fixes from StyleCI

This commit is contained in:
Alex Bilbie
2016-02-19 18:09:39 -05:00
committed by StyleCI Bot
parent 60c45ab8fe
commit a2460886f6
57 changed files with 346 additions and 330 deletions

View File

@@ -1,14 +1,13 @@
<?php
/**
* OAuth 2.0 Abstract Response Type
* OAuth 2.0 Abstract Response Type.
*
* @package league/oauth2-server
* @author Alex Bilbie <hello@alexbilbie.com>
* @copyright Copyright (c) Alex Bilbie
* @license http://mit-license.org/
*
* @link https://github.com/thephpleague/oauth2-server
*/
namespace League\OAuth2\Server\ResponseTypes;
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;

View File

@@ -1,14 +1,13 @@
<?php
/**
* OAuth 2.0 Bearer Token Type
* OAuth 2.0 Bearer Token Type.
*
* @package league/oauth2-server
* @author Alex Bilbie <hello@alexbilbie.com>
* @copyright Copyright (c) Alex Bilbie
* @license http://mit-license.org/
*
* @link https://github.com/thephpleague/oauth2-server
*/
namespace League\OAuth2\Server\ResponseTypes;
use Lcobucci\JWT\Builder;
@@ -43,7 +42,7 @@ class BearerTokenResponse extends AbstractResponseType
$responseParams = [
'token_type' => 'Bearer',
'expires_in' => $expireDateTime - (new \DateTime)->getTimestamp(),
'expires_in' => $expireDateTime - (new \DateTime())->getTimestamp(),
'access_token' => (string) $jwtAccessToken,
];

View File

@@ -1,14 +1,13 @@
<?php
/**
* OAuth 2.0 MAC Token Type
* OAuth 2.0 MAC Token Type.
*
* @package league/oauth2-server
* @author Alex Bilbie <hello@alexbilbie.com>
* @copyright Copyright (c) Alex Bilbie
* @license http://mit-license.org/
*
* @link https://github.com/thephpleague/oauth2-server
*/
namespace League\OAuth2\Server\TokenTypes;
use League\OAuth2\Server\Util\SecureKey;
@@ -16,7 +15,7 @@ use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\Request;
/**
* MAC Token Type
* MAC Token Type.
*/
class MAC extends AbstractTokenType implements TokenTypeInterface
{
@@ -29,11 +28,11 @@ class MAC extends AbstractTokenType implements TokenTypeInterface
$this->server->getMacStorage()->create($macKey, $this->getParam('access_token'));
$response = [
'access_token' => $this->getParam('access_token'),
'token_type' => 'mac',
'expires_in' => $this->getParam('expires_in'),
'mac_key' => $macKey,
'mac_algorithm' => 'hmac-sha-256',
'access_token' => $this->getParam('access_token'),
'token_type' => 'mac',
'expires_in' => $this->getParam('expires_in'),
'mac_key' => $macKey,
'mac_algorithm' => 'hmac-sha-256',
];
return $response;
@@ -121,9 +120,11 @@ class MAC extends AbstractTokenType implements TokenTypeInterface
}
/**
* Prevent timing attack
* @param string $knownString
* @param string $userString
* Prevent timing attack.
*
* @param string $knownString
* @param string $userString
*
* @return bool
*/
private function hash_equals($knownString, $userString)

View File

@@ -1,14 +1,13 @@
<?php
/**
* OAuth 2.0 Response Type Interface
* OAuth 2.0 Response Type Interface.
*
* @package league/oauth2-server
* @author Alex Bilbie <hello@alexbilbie.com>
* @copyright Copyright (c) Alex Bilbie
* @license http://mit-license.org/
*
* @link https://github.com/thephpleague/oauth2-server
*/
namespace League\OAuth2\Server\ResponseTypes;
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;
@@ -30,7 +29,7 @@ interface ResponseTypeInterface
/**
* Determine the access token in the authorization header and append OAUth properties to the request
* as attributes
* as attributes.
*
* @param ServerRequestInterface $request
*