Import DateTime instead of using root namespace

This commit is contained in:
Alex Bilbie 2015-04-06 08:08:18 +01:00
parent a15995c126
commit 385b03db6f

View File

@ -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();
}
}