| @@ 216-225 (lines=10) @@ | ||
| 213 | * |
|
| 214 | * @return bool |
|
| 215 | */ |
|
| 216 | public function isExpired(\DateTime $currentTime = null) |
|
| 217 | { |
|
| 218 | if (null === $expiresAt = $this->get(self::CLAIM_EXP)) { |
|
| 219 | return false; |
|
| 220 | } |
|
| 221 | ||
| 222 | $currentTime = $currentTime ?: new \DateTime('now'); |
|
| 223 | ||
| 224 | return $expiresAt < $currentTime->getTimestamp(); |
|
| 225 | } |
|
| 226 | ||
| 227 | /** |
|
| 228 | * @param \DateTime|null $currentTime |
|
| @@ 232-241 (lines=10) @@ | ||
| 229 | * |
|
| 230 | * @return bool |
|
| 231 | */ |
|
| 232 | public function isAcceptable(\DateTime $currentTime = null) |
|
| 233 | { |
|
| 234 | if (null === $notBefore = $this->get(self::CLAIM_NBF)) { |
|
| 235 | return true; |
|
| 236 | } |
|
| 237 | ||
| 238 | $currentTime = $currentTime ?: new \DateTime('now'); |
|
| 239 | ||
| 240 | return $currentTime->getTimestamp() > $notBefore; |
|
| 241 | } |
|
| 242 | ||
| 243 | /** |
|
| 244 | * @param string $key |
|