diff --git a/src/Token/AccessToken.php b/src/Token/AccessToken.php index 81533c30..08e65666 100644 --- a/src/Token/AccessToken.php +++ b/src/Token/AccessToken.php @@ -22,7 +22,7 @@ * * @link http://tools.ietf.org/html/rfc6749#section-1.4 Access Token (RFC 6749, ยง1.4) */ -class AccessToken implements AccessTokenInterface, ResourceOwnerAccessTokenInterface +class AccessToken implements AccessTokenInterface, ResourceOwnerAccessTokenInterface, ArrayableAccessTokenInterface { /** * @var string @@ -214,11 +214,11 @@ public function __toString() { return (string) $this->getToken(); } - + /** * @inheritdoc */ - public function jsonSerialize() + public function toArray() { $parameters = $this->values; @@ -240,4 +240,12 @@ public function jsonSerialize() return $parameters; } + + /** + * @inheritdoc + */ + public function jsonSerialize() + { + return $this->toArray(); + } } diff --git a/src/Token/ArrayableAccessTokenInterface.php b/src/Token/ArrayableAccessTokenInterface.php new file mode 100644 index 00000000..a5f87511 --- /dev/null +++ b/src/Token/ArrayableAccessTokenInterface.php @@ -0,0 +1,16 @@ +