Added ability to cast token as a string

This commit is contained in:
Alex Bilbie 2014-05-09 08:16:02 +01:00
parent d40ee11ef5
commit 11664e6d37

View File

@ -147,6 +147,19 @@ abstract class AbstractTokenEntity
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
* @return void