Added isExpired method

This commit is contained in:
Alex Bilbie committed 2015-04-05 21:57:17 +01:00
1 parent a0d5d5817b
commit f4cfd37745
2 files changed
+15

No files matched your search

@@ -76,4 +76,10 @@ interface TokenInterface
* @return ScopeEntityInterface[]
*/
public function getScopes();
/**
* Has the token expired?
* @return bool
*/
public function isExpired();
}
+9
View File
@@ -123,4 +123,13 @@ trait TokenEntityTrait
{
$this->client = $client;
}
/**
* Has the token expired?
* @return bool
*/
public function isExpired()
{
return (new \DateTime()) > $this->getExpiryDateTime();
}
}