Skip to content

Commit

Permalink
Merge pull request #65 from carlos-ea/patch-1
Browse files Browse the repository at this point in the history
Use DateTimeInterface instead of DateTime
  • Loading branch information
spideyfusion authored Jun 13, 2019
2 parents 5fb4c7e + 355895a commit 4549252
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Model/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Trikoder\Bundle\OAuth2Bundle\Model;

use DateTime;
use DateTimeInterface;

class AccessToken
{
Expand All @@ -14,7 +14,7 @@ class AccessToken
private $identifier;

/**
* @var DateTime
* @var DateTimeInterface
*/
private $expiry;

Expand All @@ -40,7 +40,7 @@ class AccessToken

public function __construct(
string $identifier,
DateTime $expiry,
DateTimeInterface $expiry,
Client $client,
?string $userIdentifier,
array $scopes
Expand All @@ -62,7 +62,7 @@ public function getIdentifier(): string
return $this->identifier;
}

public function getExpiry(): DateTime
public function getExpiry(): DateTimeInterface
{
return $this->expiry;
}
Expand Down
8 changes: 4 additions & 4 deletions Model/AuthorizationCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Trikoder\Bundle\OAuth2Bundle\Model;

use DateTime;
use DateTimeInterface;

class AuthorizationCode
{
Expand All @@ -14,7 +14,7 @@ class AuthorizationCode
private $identifier;

/**
* @var DateTime
* @var DateTimeInterface
*/
private $expiry;

Expand All @@ -40,7 +40,7 @@ class AuthorizationCode

public function __construct(
string $identifier,
DateTime $expiry,
DateTimeInterface $expiry,
Client $client,
?string $userIdentifier,
array $scopes)
Expand All @@ -62,7 +62,7 @@ public function getIdentifier(): string
return $this->identifier;
}

public function getExpiryDateTime(): DateTime
public function getExpiryDateTime(): DateTimeInterface
{
return $this->expiry;
}
Expand Down
8 changes: 4 additions & 4 deletions Model/RefreshToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Trikoder\Bundle\OAuth2Bundle\Model;

use DateTime;
use DateTimeInterface;

class RefreshToken
{
Expand All @@ -14,7 +14,7 @@ class RefreshToken
private $identifier;

/**
* @var DateTime
* @var DateTimeInterface
*/
private $expiry;

Expand All @@ -28,7 +28,7 @@ class RefreshToken
*/
private $revoked = false;

public function __construct(string $identifier, DateTime $expiry, AccessToken $accessToken)
public function __construct(string $identifier, DateTimeInterface $expiry, AccessToken $accessToken)
{
$this->identifier = $identifier;
$this->expiry = $expiry;
Expand All @@ -45,7 +45,7 @@ public function getIdentifier(): string
return $this->identifier;
}

public function getExpiry(): DateTime
public function getExpiry(): DateTimeInterface
{
return $this->expiry;
}
Expand Down

0 comments on commit 4549252

Please sign in to comment.