Renamed method make to generate

This commit is contained in:
Alex Bilbie 2014-04-06 21:08:20 +01:00
parent ac29fc4a62
commit b2c07aa68f
5 changed files with 9 additions and 9 deletions

View File

@ -115,7 +115,7 @@ abstract class AbstractToken
*/
public function setToken($token = null)
{
$this->token = ($token !== null) ? $token : SecureKey::make();
$this->token = ($token !== null) ? $token : SecureKey::generate();
return $this;
}

View File

@ -163,7 +163,7 @@ class AuthCode extends AbstractGrant
// Create a new auth code
$authCode = new AC($this->server);
$authCode->setToken(SecureKey::make());
$authCode->setToken(SecureKey::generate());
$authCode->setRedirectUri($authParams['redirect_uri']);
foreach ($authParams['scopes'] as $scope) {
@ -250,7 +250,7 @@ class AuthCode extends AbstractGrant
// Generate the access token
$accessToken = new AccessToken($this->server);
$accessToken->setToken(SecureKey::make());
$accessToken->setToken(SecureKey::generate());
$accessToken->setExpireTime($this->server->getAccessTokenTTL() + time());
foreach ($authCodeScopes as $authCodeScope) {
@ -267,7 +267,7 @@ class AuthCode extends AbstractGrant
// Associate a refresh token if set
if ($this->server->hasGrantType('refresh_token')) {
$refreshToken = new RefreshToken($this->server);
$refreshToken->setToken(SecureKey::make());
$refreshToken->setToken(SecureKey::generate());
$refreshToken->setExpireTime($this->server->getGrantType('refresh_token')->getRefreshTokenTTL() + time());
$response['refresh_token'] = $refreshToken->getToken();
}

View File

@ -98,7 +98,7 @@ class ClientCredentials extends AbstractGrant
// Generate an access token
$accessToken = new AccessToken($this->server);
$accessToken->setToken(SecureKey::make());
$accessToken->setToken(SecureKey::generate());
$accessToken->setExpireTime($this->server->getAccessTokenTTL() + time());
// Associate scopes with the session and access token

View File

@ -146,7 +146,7 @@ class Password extends AbstractGrant
// Generate an access token
$accessToken = new AccessToken($this->server);
$accessToken->setToken(SecureKey::make());
$accessToken->setToken(SecureKey::generate());
$accessToken->setExpireTime($this->server->getAccessTokenTTL() + time());
// Associate scopes with the session and access token
@ -165,7 +165,7 @@ class Password extends AbstractGrant
// Associate a refresh token if set
if ($this->server->hasGrantType('refresh_token')) {
$refreshToken = new RT($this->server);
$refreshToken->setToken(SecureKey::make());
$refreshToken->setToken(SecureKey::generate());
$refreshToken->setExpireTime($this->server->getGrantType('refresh_token')->getRefreshTokenTTL() + time());
$response['refresh_token'] = $refreshToken->getToken();
}

View File

@ -136,7 +136,7 @@ class RefreshToken extends AbstractGrant
// Generate a new access token and assign it the correct sessions
$newAccessToken = new AccessToken($this->server);
$newAccessToken->setToken(SecureKey::make());
$newAccessToken->setToken(SecureKey::generate());
$newAccessToken->setExpireTime($this->server->getAccessTokenTTL() + time());
$newAccessToken->setSession($session);
@ -160,7 +160,7 @@ class RefreshToken extends AbstractGrant
// Generate a new refresh token
$newRefreshToken = new RT($this->server);
$newRefreshToken->setToken(SecureKey::make());
$newRefreshToken->setToken(SecureKey::generate());
$newRefreshToken->setExpireTime($this->getRefreshTokenTTL() + time());
$newRefreshToken->setAccessToken($newAccessToken);
$newRefreshToken->save($this->server->getStorage('refresh_token'));