Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| MissingClaimsException | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getMissingClaims | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace DevToolbelt\JwtTokenManager\Exceptions; |
| 6 | |
| 7 | final class MissingClaimsException extends JwtException |
| 8 | { |
| 9 | protected string $errorKey = 'missingClaims'; |
| 10 | |
| 11 | /** |
| 12 | * @param array<string> $claims |
| 13 | */ |
| 14 | public function __construct( |
| 15 | private readonly array $claims |
| 16 | ) { |
| 17 | parent::__construct('Token is missing required claims: ' . implode(', ', $claims)); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * @return array<string> |
| 22 | */ |
| 23 | public function getMissingClaims(): array |
| 24 | { |
| 25 | return $this->claims; |
| 26 | } |
| 27 | } |