Removed generic getStorage method and replaced with distinct calls to getters

This commit is contained in:
Alex Bilbie
2014-11-07 02:20:06 +00:00
parent 9bb7af6f83
commit 3815355489
18 changed files with 213 additions and 169 deletions

View File

@@ -153,7 +153,7 @@ abstract class AbstractGrant implements GrantTypeInterface
$scopes = [];
foreach ($scopesList as $scopeItem) {
$scope = $this->server->getStorage('scope')->get(
$scope = $this->server->getScopeStorage()->get(
$scopeItem,
$this->getIdentifier(),
$client->getId()

View File

@@ -85,7 +85,7 @@ class AuthCodeGrant extends AbstractGrant
}
// Validate client ID and redirect URI
$client = $this->server->getStorage('client')->get(
$client = $this->server->getClientStorage()->get(
$clientId,
null,
$redirectUri,
@@ -186,7 +186,7 @@ class AuthCodeGrant extends AbstractGrant
}
// Validate client ID and client secret
$client = $this->server->getStorage('client')->get(
$client = $this->server->getClientStorage()->get(
$clientId,
$clientSecret,
$redirectUri,
@@ -204,7 +204,7 @@ class AuthCodeGrant extends AbstractGrant
throw new Exception\InvalidRequestException('code');
}
$code = $this->server->getStorage('auth_code')->get($authCode);
$code = $this->server->getAuthCodeStorage()->get($authCode);
if (($code instanceof AuthCodeEntity) === false) {
throw new Exception\InvalidRequestException('code');
}

View File

@@ -71,7 +71,7 @@ class ClientCredentialsGrant extends AbstractGrant
}
// Validate client ID and client secret
$client = $this->server->getStorage('client')->get(
$client = $this->server->getClientStorage()->get(
$clientId,
$clientSecret,
null,

View File

@@ -95,7 +95,7 @@ class PasswordGrant extends AbstractGrant
}
// Validate client ID and client secret
$client = $this->server->getStorage('client')->get(
$client = $this->server->getClientStorage()->get(
$clientId,
$clientSecret,
null,

View File

@@ -76,7 +76,7 @@ class RefreshTokenGrant extends AbstractGrant
}
// Validate client ID and client secret
$client = $this->server->getStorage('client')->get(
$client = $this->server->getClientStorage()->get(
$clientId,
$clientSecret,
null,
@@ -94,7 +94,7 @@ class RefreshTokenGrant extends AbstractGrant
}
// Validate refresh token
$oldRefreshToken = $this->server->getStorage('refresh_token')->get($oldRefreshTokenParam);
$oldRefreshToken = $this->server->getRefreshTokenStorage()->get($oldRefreshTokenParam);
if (($oldRefreshToken instanceof RefreshTokenEntity) === false) {
throw new Exception\InvalidRefreshException();
@@ -136,7 +136,7 @@ class RefreshTokenGrant extends AbstractGrant
}
// Expire the old token and save the new one
$oldAccessToken->expire($this->server->getStorage('access_token'));
$oldAccessToken->expire();
$newAccessToken->save();
$this->server->getTokenType()->setSession($session);