| Total Complexity | 7 |
| Total Lines | 89 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | abstract class Token implements TokenInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $token; |
||
| 18 | /** |
||
| 19 | * @var string[] |
||
| 20 | */ |
||
| 21 | protected $scopes; |
||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $clientIdentifier; |
||
| 26 | /** |
||
| 27 | * @var string|null |
||
| 28 | */ |
||
| 29 | protected $resourceOwnerIdentifier; |
||
| 30 | /** |
||
| 31 | * @var \DateTimeInterface |
||
| 32 | */ |
||
| 33 | protected $expiresAt; |
||
| 34 | /** |
||
| 35 | * @var string|null |
||
| 36 | */ |
||
| 37 | protected $authorizationCode; |
||
| 38 | /** |
||
| 39 | * @var string|null |
||
| 40 | */ |
||
| 41 | protected $refreshToken; |
||
| 42 | |||
| 43 | public function __construct(string $token, array $scopes, string $clientIdentifier, ?string $resourceOwnerIdentifier, |
||
| 44 | \DateTimeInterface $expiresAt, ?string $authorizationCode = null, ?string $refreshToken = null) |
||
| 45 | { |
||
| 46 | $this->token = $token; |
||
| 47 | $this->scopes = $scopes; |
||
| 48 | $this->clientIdentifier = $clientIdentifier; |
||
| 49 | $this->resourceOwnerIdentifier = $resourceOwnerIdentifier; |
||
| 50 | $this->expiresAt = $expiresAt; |
||
| 51 | $this->authorizationCode = $authorizationCode; |
||
| 52 | $this->refreshToken = $refreshToken; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function getToken(): string |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return string[] |
||
| 65 | */ |
||
| 66 | public function getScopes(): array |
||
| 67 | { |
||
| 68 | return $this->scopes; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @return string |
||
| 73 | */ |
||
| 74 | public function getClientIdentifier(): string |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @return string|null |
||
| 81 | */ |
||
| 82 | public function getResourceOwnerIdentifier(): ?string |
||
| 83 | { |
||
| 84 | return $this->resourceOwnerIdentifier; |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @return \DateTimeInterface |
||
| 89 | */ |
||
| 90 | public function getExpiresAt(): \DateTimeInterface |
||
| 93 | } |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @return string |
||
| 97 | */ |
||
| 98 | public function getAuthorizationCode(): ?string |
||
| 103 | } |