Added isExpired method

This commit is contained in:
Alex Bilbie 2015-04-05 21:57:17 +01:00
parent a0d5d5817b
commit f4cfd37745
2 changed files with 15 additions and 0 deletions

View File

@ -76,4 +76,10 @@ interface TokenInterface
* @return ScopeEntityInterface[] * @return ScopeEntityInterface[]
*/ */
public function getScopes(); public function getScopes();
/**
* Has the token expired?
* @return bool
*/
public function isExpired();
} }

View File

@ -123,4 +123,13 @@ trait TokenEntityTrait
{ {
$this->client = $client; $this->client = $client;
} }
/**
* Has the token expired?
* @return bool
*/
public function isExpired()
{
return (new \DateTime()) > $this->getExpiryDateTime();
}
} }