mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-24 05:59:48 +05:30
Import DateTime instead of using root namespace
This commit is contained in:
parent
a15995c126
commit
385b03db6f
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace League\OAuth2\Server\Entities\Traits;
|
||||
|
||||
use DateTime;
|
||||
use League\OAuth2\Server\Entities\Interfaces\ClientEntityInterface;
|
||||
use League\OAuth2\Server\Entities\Interfaces\ScopeEntityInterface;
|
||||
|
||||
@ -12,7 +13,7 @@ trait TokenEntityTrait
|
||||
protected $scopes = [];
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
* @var DateTime
|
||||
*/
|
||||
protected $expiryDateTime;
|
||||
|
||||
@ -61,7 +62,7 @@ trait TokenEntityTrait
|
||||
|
||||
/**
|
||||
* Get the token's expiry date time
|
||||
* @return \DateTime
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getExpiryDateTime()
|
||||
{
|
||||
@ -70,9 +71,9 @@ trait TokenEntityTrait
|
||||
|
||||
/**
|
||||
* Set the date time when the token expires
|
||||
* @param \DateTime $dateTime
|
||||
* @param DateTime $dateTime
|
||||
*/
|
||||
public function setExpiryDateTime(\DateTime $dateTime)
|
||||
public function setExpiryDateTime(DateTime $dateTime)
|
||||
{
|
||||
$this->expiryDateTime = $dateTime;
|
||||
}
|
||||
@ -130,6 +131,6 @@ trait TokenEntityTrait
|
||||
*/
|
||||
public function isExpired()
|
||||
{
|
||||
return (new \DateTime()) > $this->getExpiryDateTime();
|
||||
return (new DateTime()) > $this->getExpiryDateTime();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user