Namespace renamed TokenType > TokenTypes

This commit is contained in:
Alex Bilbie 2015-04-04 15:41:53 +01:00
parent 7c57310b67
commit 027971776b
4 changed files with 20 additions and 52 deletions

View File

@ -9,12 +9,11 @@
* @link https://github.com/thephpleague/oauth2-server
*/
namespace League\OAuth2\Server\TokenType;
namespace League\OAuth2\Server\TokenTypes;
use League\OAuth2\Server\AbstractServer;
use League\OAuth2\Server\Entity\SessionEntity;
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;
abstract class AbstractTokenType
abstract class AbstractTokenType implements TokenTypeInterface
{
/**
* Response array
@ -24,38 +23,9 @@ abstract class AbstractTokenType
protected $response = [];
/**
* Server
*
* @var \League\OAuth2\Server\AbstractServer $server
* @var \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface
*/
protected $server;
/**
* Server
*
* @var \League\OAuth2\Server\Entity\SessionEntity $session
*/
protected $session;
/**
* {@inheritdoc}
*/
public function setServer(AbstractServer $server)
{
$this->server = $server;
return $this;
}
/**
* {@inheritdoc}
*/
public function setSession(SessionEntity $session)
{
$this->session = $session;
return $this;
}
protected $accessToken;
/**
* {@inheritdoc}
@ -72,4 +42,12 @@ abstract class AbstractTokenType
{
return isset($this->response[$key]) ? $this->response[$key] : null;
}
/**
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessToken
*/
public function setAccessToken(AccessTokenEntityInterface $accessToken)
{
$this->accessToken = $accessToken;
}
}

View File

@ -9,11 +9,11 @@
* @link https://github.com/thephpleague/oauth2-server
*/
namespace League\OAuth2\Server\TokenType;
namespace League\OAuth2\Server\TokenTypes;
use Symfony\Component\HttpFoundation\Request;
class Bearer extends AbstractTokenType implements TokenTypeInterface
class Bearer extends AbstractTokenType
{
/**
* {@inheritdoc}

View File

@ -9,7 +9,7 @@
* @link https://github.com/thephpleague/oauth2-server
*/
namespace League\OAuth2\Server\TokenType;
namespace League\OAuth2\Server\TokenTypes;
use League\OAuth2\Server\Util\SecureKey;
use Symfony\Component\HttpFoundation\ParameterBag;

View File

@ -9,9 +9,10 @@
* @link https://github.com/thephpleague/oauth2-server
*/
namespace League\OAuth2\Server\TokenType;
namespace League\OAuth2\Server\TokenTypes;
use League\OAuth2\Server\AbstractServer;
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;
use League\OAuth2\Server\Entity\SessionEntity;
use Symfony\Component\HttpFoundation\Request;
@ -25,13 +26,9 @@ interface TokenTypeInterface
public function generateResponse();
/**
* Set the server
*
* @param \League\OAuth2\Server\AbstractServer $server
*
* @return self
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessToken
*/
public function setServer(AbstractServer $server);
public function setAccessToken(AccessTokenEntityInterface $accessToken);
/**
* Set a key/value response pair
@ -50,13 +47,6 @@ interface TokenTypeInterface
*/
public function getParam($key);
/**
* @param \League\OAuth2\Server\Entity\SessionEntity $session
*
* @return self
*/
public function setSession(SessionEntity $session);
/**
* Determine the access token in the authorization header
*