mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
cleanup DateTime handline
* DateTime -> DateTimeImmutable
* DateTime::format('U') -> DateTime::getTimestamp()
* (new DateTime())->getTimestamp() -> time()
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
namespace League\OAuth2\Server\Entities;
|
||||
|
||||
use DateTimeImmutable;
|
||||
|
||||
interface TokenInterface
|
||||
{
|
||||
/**
|
||||
@@ -28,16 +30,16 @@ interface TokenInterface
|
||||
/**
|
||||
* Get the token's expiry date time.
|
||||
*
|
||||
* @return \DateTime
|
||||
* @return DateTimeImmutable
|
||||
*/
|
||||
public function getExpiryDateTime();
|
||||
public function getExpiryDateTime(): DateTimeImmutable;
|
||||
|
||||
/**
|
||||
* Set the date time when the token expires.
|
||||
*
|
||||
* @param \DateTime $dateTime
|
||||
* @param DateTimeImmutable $dateTime
|
||||
*/
|
||||
public function setExpiryDateTime(\DateTime $dateTime);
|
||||
public function setExpiryDateTime(DateTimeImmutable $dateTime);
|
||||
|
||||
/**
|
||||
* Set the identifier of the user associated with the token.
|
||||
|
||||
Reference in New Issue
Block a user