mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-03-05 16:07:47 +05:30
Added ability to cast token as a string
This commit is contained in:
parent
d40ee11ef5
commit
11664e6d37
@ -147,6 +147,19 @@ abstract class AbstractTokenEntity
|
|||||||
return $scopes;
|
return $scopes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the token as a string if the object is cast as a string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
if (is_null($this->token)) {
|
||||||
|
throw new \BadMethodCallException('Token is null');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->token;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expire the token
|
* Expire the token
|
||||||
* @return void
|
* @return void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user