Merge pull request #600 from zerkms/ISSUE-598_REDUNDANT_IS_EXPIRED

Removed isExpired() from interfaces and traits
This commit is contained in:
Alex Bilbie 2016-06-17 09:14:38 +01:00 committed by GitHub
commit c6e5f12a7c
5 changed files with 0 additions and 36 deletions

View File

@ -52,11 +52,4 @@ interface RefreshTokenEntityInterface
* @return \League\OAuth2\Server\Entities\AccessTokenEntityInterface * @return \League\OAuth2\Server\Entities\AccessTokenEntityInterface
*/ */
public function getAccessToken(); public function getAccessToken();
/**
* Has the token expired?
*
* @return bool
*/
public function isExpired();
} }

View File

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

View File

@ -59,14 +59,4 @@ trait RefreshTokenTrait
{ {
$this->expiryDateTime = $dateTime; $this->expiryDateTime = $dateTime;
} }
/**
* Has the token expired?
*
* @return bool
*/
public function isExpired()
{
return (new DateTime()) > $this->getExpiryDateTime();
}
} }

View File

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

View File

@ -275,7 +275,6 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase
/** @var RefreshTokenEntityInterface $refreshToken */ /** @var RefreshTokenEntityInterface $refreshToken */
$refreshToken = $issueRefreshTokenMethod->invoke($grantMock, $accessToken); $refreshToken = $issueRefreshTokenMethod->invoke($grantMock, $accessToken);
$this->assertTrue($refreshToken instanceof RefreshTokenEntityInterface); $this->assertTrue($refreshToken instanceof RefreshTokenEntityInterface);
$this->assertFalse($refreshToken->isExpired());
$this->assertEquals($accessToken, $refreshToken->getAccessToken()); $this->assertEquals($accessToken, $refreshToken->getAccessToken());
} }
@ -301,7 +300,6 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase
[new ScopeEntity()] [new ScopeEntity()]
); );
$this->assertTrue($accessToken instanceof AccessTokenEntityInterface); $this->assertTrue($accessToken instanceof AccessTokenEntityInterface);
$this->assertFalse($accessToken->isExpired());
} }
public function testIssueAuthCode() public function testIssueAuthCode()