mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-23 05:29:52 +05:30
Inject server into tokentype
This commit is contained in:
parent
b68a5c2abb
commit
1e3a192920
@ -125,6 +125,7 @@ abstract class AbstractServer
|
|||||||
*/
|
*/
|
||||||
public function setTokenType(TokenTypeInterface $tokenType)
|
public function setTokenType(TokenTypeInterface $tokenType)
|
||||||
{
|
{
|
||||||
|
$tokenType->setServer($this);
|
||||||
$this->tokenType = $tokenType;
|
$this->tokenType = $tokenType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace League\OAuth2\Server\TokenType;
|
namespace League\OAuth2\Server\TokenType;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use League\OAuth2\Server\AbstractServer;
|
||||||
|
|
||||||
abstract class AbstractTokenType
|
abstract class AbstractTokenType
|
||||||
{
|
{
|
||||||
@ -22,6 +23,21 @@ abstract class AbstractTokenType
|
|||||||
protected $response = [];
|
protected $response = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Server
|
||||||
|
* @var \League\OAuth2\Server\AbstractServer $server
|
||||||
|
*/
|
||||||
|
protected $server;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the server
|
||||||
|
* @param \League\OAuth2\Server\AbstractServer $server
|
||||||
|
*/
|
||||||
|
public function setServer(AbstractServer $server)
|
||||||
|
{
|
||||||
|
$this->server = $server;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
* Set a key/value response pair
|
* Set a key/value response pair
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
|
Loading…
Reference in New Issue
Block a user