mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-25 06:30:13 +05:30
Updated AbstractResponseType with interface methods
This commit is contained in:
parent
fd47712060
commit
1bdad3ad14
@ -12,15 +12,14 @@
|
||||
namespace League\OAuth2\Server\ResponseTypes;
|
||||
|
||||
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;
|
||||
use League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface;
|
||||
|
||||
abstract class AbstractResponseType implements ResponseTypeInterface
|
||||
{
|
||||
/**
|
||||
* Response array for JSON serialization
|
||||
*
|
||||
* @var array
|
||||
* @var string
|
||||
*/
|
||||
protected $response = [];
|
||||
protected $pathToPrivateKey;
|
||||
|
||||
/**
|
||||
* @var \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface
|
||||
@ -28,19 +27,16 @@ abstract class AbstractResponseType implements ResponseTypeInterface
|
||||
protected $accessToken;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @var \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface
|
||||
*/
|
||||
public function setParam($key, $value)
|
||||
{
|
||||
$this->response[$key] = $value;
|
||||
}
|
||||
protected $refreshToken;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @param string $pathToPrivateKey
|
||||
*/
|
||||
public function getParam($key)
|
||||
public function __construct($pathToPrivateKey)
|
||||
{
|
||||
return isset($this->response[$key]) ? $this->response[$key] : null;
|
||||
$this->pathToPrivateKey = $pathToPrivateKey;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -50,4 +46,12 @@ abstract class AbstractResponseType implements ResponseTypeInterface
|
||||
{
|
||||
$this->accessToken = $accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \League\OAuth2\Server\Entities\Interfaces\RefreshTokenEntityInterface $refreshToken
|
||||
*/
|
||||
public function setRefreshToken(RefreshTokenEntityInterface $refreshToken)
|
||||
{
|
||||
$this->refreshToken = $refreshToken;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user