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

View File

@ -7,16 +7,9 @@ use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
class ClientRepository implements ClientRepositoryInterface
{
/**
* Get a client
*
* @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
* @inheritdoc
*/
public function get($clientIdentifier, $clientSecret = null, $redirectUri = null, $grantType = null)
public function getClientEntity($clientIdentifier, $clientSecret = null, $redirectUri = null, $grantType = null)
{
$clients = [
'myawesomeapp' => [

View File

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