From 6b88cbeb137187687a50c2ec27d162fea56b7eb1 Mon Sep 17 00:00:00 2001 From: Ivan Kurnosov Date: Fri, 17 Jun 2016 19:50:04 +1200 Subject: [PATCH] Removed isExpired() from interfaces and traits --- src/Entities/RefreshTokenEntityInterface.php | 7 ------- src/Entities/TokenInterface.php | 7 ------- src/Entities/Traits/RefreshTokenTrait.php | 10 ---------- src/Entities/Traits/TokenEntityTrait.php | 10 ---------- tests/Grant/AbstractGrantTest.php | 2 -- 5 files changed, 36 deletions(-) diff --git a/src/Entities/RefreshTokenEntityInterface.php b/src/Entities/RefreshTokenEntityInterface.php index 8b7d587d..c0e7bc4f 100644 --- a/src/Entities/RefreshTokenEntityInterface.php +++ b/src/Entities/RefreshTokenEntityInterface.php @@ -52,11 +52,4 @@ interface RefreshTokenEntityInterface * @return \League\OAuth2\Server\Entities\AccessTokenEntityInterface */ public function getAccessToken(); - - /** - * Has the token expired? - * - * @return bool - */ - public function isExpired(); } diff --git a/src/Entities/TokenInterface.php b/src/Entities/TokenInterface.php index 7d7c6d33..f9e5992e 100644 --- a/src/Entities/TokenInterface.php +++ b/src/Entities/TokenInterface.php @@ -80,11 +80,4 @@ interface TokenInterface * @return ScopeEntityInterface[] */ public function getScopes(); - - /** - * Has the token expired? - * - * @return bool - */ - public function isExpired(); } diff --git a/src/Entities/Traits/RefreshTokenTrait.php b/src/Entities/Traits/RefreshTokenTrait.php index 28d31a02..0734daf1 100644 --- a/src/Entities/Traits/RefreshTokenTrait.php +++ b/src/Entities/Traits/RefreshTokenTrait.php @@ -59,14 +59,4 @@ trait RefreshTokenTrait { $this->expiryDateTime = $dateTime; } - - /** - * Has the token expired? - * - * @return bool - */ - public function isExpired() - { - return (new DateTime()) > $this->getExpiryDateTime(); - } } diff --git a/src/Entities/Traits/TokenEntityTrait.php b/src/Entities/Traits/TokenEntityTrait.php index 87fdd2f4..61c1ef3c 100644 --- a/src/Entities/Traits/TokenEntityTrait.php +++ b/src/Entities/Traits/TokenEntityTrait.php @@ -114,14 +114,4 @@ trait TokenEntityTrait { $this->client = $client; } - - /** - * Has the token expired? - * - * @return bool - */ - public function isExpired() - { - return (new DateTime()) > $this->getExpiryDateTime(); - } } diff --git a/tests/Grant/AbstractGrantTest.php b/tests/Grant/AbstractGrantTest.php index 0c4f6ae7..6e516409 100644 --- a/tests/Grant/AbstractGrantTest.php +++ b/tests/Grant/AbstractGrantTest.php @@ -275,7 +275,6 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase /** @var RefreshTokenEntityInterface $refreshToken */ $refreshToken = $issueRefreshTokenMethod->invoke($grantMock, $accessToken); $this->assertTrue($refreshToken instanceof RefreshTokenEntityInterface); - $this->assertFalse($refreshToken->isExpired()); $this->assertEquals($accessToken, $refreshToken->getAccessToken()); } @@ -301,7 +300,6 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase [new ScopeEntity()] ); $this->assertTrue($accessToken instanceof AccessTokenEntityInterface); - $this->assertFalse($accessToken->isExpired()); } public function testIssueAuthCode()