| 1 | <?php |
||
| 5 | class AccessToken implements AccessTokenInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string |
||
| 9 | */ |
||
| 10 | private $token; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private $tokenType; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var int |
||
| 19 | */ |
||
| 20 | private $expiresIn; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Token created at, it's need to check expiration |
||
| 24 | * |
||
| 25 | * @var int |
||
| 26 | */ |
||
| 27 | private $createdTime; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * API call delays and any delay between the time the token is retrieved and subsequently used |
||
| 31 | * |
||
| 32 | * @var int |
||
| 33 | */ |
||
| 34 | private static $expiryBuffer = 120; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var string |
||
| 38 | */ |
||
| 39 | private $requestId; |
||
| 40 | |||
| 41 | public function __construct() |
||
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | public function getToken() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * {@inheritdoc} |
||
| 56 | */ |
||
| 57 | public function setToken($token) |
||
| 61 | |||
| 62 | /** |
||
| 63 | * {@inheritdoc} |
||
| 64 | */ |
||
| 65 | public function setExpiresIn($expiresIn) |
||
| 69 | |||
| 70 | /** |
||
| 71 | * {@inheritdoc} |
||
| 72 | */ |
||
| 73 | public function getExpiresIn() |
||
| 77 | |||
| 78 | /** |
||
| 79 | * {@inheritdoc} |
||
| 80 | */ |
||
| 81 | public function isExpired() |
||
| 85 | |||
| 86 | /** |
||
| 87 | * {@inheritdoc} |
||
| 88 | */ |
||
| 89 | public function getRequestId() |
||
| 97 | |||
| 98 | /** |
||
| 99 | * {@inheritdoc} |
||
| 100 | */ |
||
| 101 | public function getTokenType() |
||
| 105 | |||
| 106 | /** |
||
| 107 | * {@inheritdoc} |
||
| 108 | */ |
||
| 109 | public function setTokenType($tokenType) |
||
| 113 | } |
||
| 114 |