diff --git a/src/Repositories/AccessTokenRepositoryInterface.php b/src/Repositories/AccessTokenRepositoryInterface.php index 41e3011c..13d0c5da 100644 --- a/src/Repositories/AccessTokenRepositoryInterface.php +++ b/src/Repositories/AccessTokenRepositoryInterface.php @@ -22,11 +22,11 @@ interface AccessTokenRepositoryInterface extends RepositoryInterface /** * Get an instance of Entity\AccessTokenEntity * - * @param string $tokenIdentifier The access token identifier + * @param string $token The access token identifier * * @return \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface */ - public function get($tokenIdentifier); + public function getAccessTokenEntityByTokenString($token); /** * Get the scopes for an access token @@ -35,14 +35,14 @@ interface AccessTokenRepositoryInterface extends RepositoryInterface * * @return \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface[] */ - public function getScopes(AccessTokenEntityInterface $token); + public function getScopeEntitiesAssociatedWithAccessToken(AccessTokenEntityInterface $token); /** - * Creates a new access token + * Persists a new access token to storage * * @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessTokenEntity */ - public function create(AccessTokenEntityInterface $accessTokenEntity); + public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity); /** * Associate a scope with an access token @@ -50,12 +50,15 @@ interface AccessTokenRepositoryInterface extends RepositoryInterface * @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessTokenEntityInterface * @param \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface $scope */ - public function associateScope(AccessTokenEntityInterface $accessTokenEntityInterface, ScopeEntityInterface $scope); + public function associateScopeWithAccessToken( + AccessTokenEntityInterface $accessTokenEntityInterface, + ScopeEntityInterface $scope + ); /** * Delete an access token * * @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessToken */ - public function delete(AccessTokenEntityInterface $accessToken); + public function deleteAccessToken(AccessTokenEntityInterface $accessToken); } diff --git a/src/Repositories/AuthCodeRepositoryInterface.php b/src/Repositories/AuthCodeRepositoryInterface.php index 734f5305..85852ef3 100644 --- a/src/Repositories/AuthCodeRepositoryInterface.php +++ b/src/Repositories/AuthCodeRepositoryInterface.php @@ -25,24 +25,23 @@ interface AuthCodeRepositoryInterface extends RepositoryInterface * * @return \League\OAuth2\Server\Entities\Interfaces\AuthCodeEntityInterface */ - public function get($code); + public function getAuthCodeEntityByCodeString($code); /** - * Create an auth code. + * Persist a new authorization code * - * @param string $token The token ID + * @param string $code The authorization code string * @param integer $expireTime Token expire time - * @param integer $sessionId Session identifier * @param string $redirectUri Client redirect uri * * @return void */ - public function create($token, $expireTime, $sessionId, $redirectUri); + public function persistNewAuthCode($code, $expireTime, $redirectUri); /** * Delete an access token * * @param \League\OAuth2\Server\Entities\Interfaces\AuthCodeEntityInterface $token The access token to delete */ - public function delete(AuthCodeEntityInterface $token); + public function deleteAuthCodeEntity(AuthCodeEntityInterface $token); } diff --git a/src/Repositories/ClientRepositoryInterface.php b/src/Repositories/ClientRepositoryInterface.php index b1f16ad4..b9b9aa3a 100644 --- a/src/Repositories/ClientRepositoryInterface.php +++ b/src/Repositories/ClientRepositoryInterface.php @@ -26,5 +26,5 @@ interface ClientRepositoryInterface extends RepositoryInterface * * @return \League\OAuth2\Server\Entities\Interfaces\ClientEntityInterface */ - public function get($clientIdentifier, $clientSecret = null, $redirectUri = null, $grantType = null); + public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null, $redirectUri = null); } diff --git a/src/Repositories/MacTokenInterface.php b/src/Repositories/MacTokenInterface.php index ed5a0633..4b84b147 100644 --- a/src/Repositories/MacTokenInterface.php +++ b/src/Repositories/MacTokenInterface.php @@ -11,11 +11,13 @@ namespace League\OAuth2\Server\Storage; +use League\OAuth2\Server\Repositories\RepositoryInterface; + /** * MacTokenInterface */ -interface MacTokenInterface extends StorageInterface +interface MacTokenInterface extends RepositoryInterface { /** * Create a MAC key linked to an access token @@ -23,12 +25,12 @@ interface MacTokenInterface extends StorageInterface * @param string $accessToken * @return void */ - public function create($macKey, $accessToken); + public function persistMacTokenEntity($macKey, $accessToken); /** * Get a MAC key by access token * @param string $accessToken * @return string */ - public function getByAccessToken($accessToken); + public function getMacKeyByAccessTokenString($accessToken); } diff --git a/src/Repositories/RefreshTokenRepositoryInterface.php b/src/Repositories/RefreshTokenRepositoryInterface.php index 98c4631e..bf3e2c8e 100644 --- a/src/Repositories/RefreshTokenRepositoryInterface.php +++ b/src/Repositories/RefreshTokenRepositoryInterface.php @@ -11,6 +11,8 @@ namespace League\OAuth2\Server\Repositories; +use League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface; + /** * Refresh token interface */ @@ -19,11 +21,11 @@ interface RefreshTokenRepositoryInterface extends RepositoryInterface /** * Return a new instance of \League\OAuth2\Server\Entity\RefreshTokenEntity * - * @param string $token + * @param string $token Refresh token string * - * @return \League\OAuth2\Server\Entity\RefreshTokenEntity + * @return \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface */ - public function get($token); + public function getRefreshTokenEntityByTokenString($token); /** * Create a new refresh token_name @@ -32,16 +34,14 @@ interface RefreshTokenRepositoryInterface extends RepositoryInterface * @param integer $expireTime * @param string $accessToken * - * @return \League\OAuth2\Server\Entity\RefreshTokenEntity + * @return \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface */ - public function create($token, $expireTime, $accessToken); + public function persistNewRefreshTokenEntity($token, $expireTime, $accessToken); /** * Delete the refresh token * - * @param \League\OAuth2\Server\Entity\RefreshTokenEntity $token - * - * @return void + * @param \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface $token */ - public function delete(RefreshTokenEntity $token); + public function deleteRefreshTokenEntity(RefreshTokenEntityInterface $token); } diff --git a/src/Repositories/ScopeRepositoryInterface.php b/src/Repositories/ScopeRepositoryInterface.php index 20bf2590..276ce264 100644 --- a/src/Repositories/ScopeRepositoryInterface.php +++ b/src/Repositories/ScopeRepositoryInterface.php @@ -19,11 +19,11 @@ interface ScopeRepositoryInterface extends RepositoryInterface /** * Return information about a scope * - * @param string $scopeIdentifier The scope identifier - * @param string $grantType The grant type used in the request (default = "null") - * @param string $clientId The client sending the request (default = "null") + * @param string $identifier The scope identifier + * @param string $grantType The grant type used in the request + * @param string $clientId The client sending the request * * @return \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface */ - public function get($scopeIdentifier, $grantType = null, $clientId = null); + public function getScopeEntityByIdentifier($identifier, $grantType, $clientId = null); } diff --git a/src/Repositories/UserRepositoryInterface.php b/src/Repositories/UserRepositoryInterface.php index 818eb135..5767a5ed 100644 --- a/src/Repositories/UserRepositoryInterface.php +++ b/src/Repositories/UserRepositoryInterface.php @@ -1,15 +1,16 @@