Updated example repositories to match updated interfaces

This commit is contained in:
Alex Bilbie 2015-11-13 17:40:53 +00:00
parent b95780022a
commit 96a0c34d41
3 changed files with 17 additions and 43 deletions

View File

@ -9,56 +9,43 @@ class AccessTokenRepository implements AccessTokenRepositoryInterface
{ {
/** /**
* Get an instance of Entity\AccessTokenEntity * @inheritdoc
*
* @param string $tokenIdentifier The access token identifier
*
* @return \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface
*/ */
public function get($tokenIdentifier) public function getAccessTokenEntityByTokenString($tokenIdentifier)
{ {
// TODO: Implement get() method. // TODO: Implement get() method.
} }
/** /**
* Get the scopes for an access token * @inheritdoc
*
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $token
*
* @return \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface[]
*/ */
public function getScopes(AccessTokenEntityInterface $token) public function getScopeEntitiesAssociatedWithAccessToken(AccessTokenEntityInterface $token)
{ {
// TODO: Implement getScopes() method. // TODO: Implement getScopes() method.
} }
/** /**
* Creates a new access token * @inheritdoc
*
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessTokenEntity
*/ */
public function create(AccessTokenEntityInterface $accessTokenEntity) public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity)
{ {
// TODO: Implement create() method. // TODO: Implement create() method.
} }
/** /**
* Associate a scope with an access token * @inheritdoc
*
* @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
) {
// TODO: Implement associateScope() method. // TODO: Implement associateScope() method.
} }
/** /**
* Delete an access token * @inheritdoc
*
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessToken
*/ */
public function delete(AccessTokenEntityInterface $accessToken) public function deleteAccessToken(AccessTokenEntityInterface $accessToken)
{ {
// TODO: Implement delete() method. // TODO: Implement delete() method.
} }

View File

@ -7,16 +7,9 @@ use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
class ClientRepository implements ClientRepositoryInterface class ClientRepository implements ClientRepositoryInterface
{ {
/** /**
* Get a client * @inheritdoc
*
* @param string $clientIdentifier The client's identifier
* @param string $clientSecret The client's secret (default = "null")
* @param string $redirectUri The client's redirect URI (default = "null")
* @param string $grantType The grant type used (default = "null")
*
* @return \League\OAuth2\Server\Entities\Interfaces\ClientEntityInterface
*/ */
public function get($clientIdentifier, $clientSecret = null, $redirectUri = null, $grantType = null) public function getClientEntity($clientIdentifier, $clientSecret = null, $redirectUri = null, $grantType = null)
{ {
$clients = [ $clients = [
'myawesomeapp' => [ 'myawesomeapp' => [

View File

@ -7,15 +7,9 @@ use League\OAuth2\Server\Repositories\ScopeRepositoryInterface;
class ScopeRepository implements ScopeRepositoryInterface class ScopeRepository implements ScopeRepositoryInterface
{ {
/** /**
* Return information about a scope * @inheritdoc
*
* @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")
*
* @return \League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface
*/ */
public function get($scopeIdentifier, $grantType = null, $clientId = null) public function getScopeEntityByIdentifier($scopeIdentifier, $grantType, $clientId = null)
{ {
$scopes = [ $scopes = [
'basic' => [ 'basic' => [