minor improvements and documentation fixes

This commit is contained in:
Julián Gutiérrez
2016-01-20 10:36:16 +01:00
parent 1e1043c04f
commit 3e5889e93b
17 changed files with 37 additions and 54 deletions

View File

@@ -38,9 +38,8 @@ class RefreshTokenGrant extends AbstractGrant
/**
* @param \League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface $refreshTokenRepository
*/
public function __construct(
RefreshTokenRepositoryInterface $refreshTokenRepository
) {
public function __construct(RefreshTokenRepositoryInterface $refreshTokenRepository)
{
$this->refreshTokenRepository = $refreshTokenRepository;
}
@@ -64,7 +63,7 @@ class RefreshTokenGrant extends AbstractGrant
// the request doesn't include any new scopes
foreach ($scopes as $scope) {
if (in_array($scope->getIdentifier(), $oldRefreshToken['scopes']) === false) {
$this->emitter->emit(new Event('scope.selection.failed', $request));
$this->getEmitter()->emit(new Event('scope.selection.failed', $request));
throw OAuthServerException::invalidScope($scope->getIdentifier());
}
@@ -112,7 +111,7 @@ class RefreshTokenGrant extends AbstractGrant
$refreshTokenData = json_decode($refreshToken, true);
if ($refreshTokenData['client_id'] !== $clientId) {
$this->emitter->emit(new Event('refresh_token.client.failed', $request));
$this->getEmitter()->emit(new Event('refresh_token.client.failed', $request));
throw OAuthServerException::invalidRefreshToken(
'Token is not linked to client,' .