| Total Complexity | 7 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | final class Parser implements TokenParser |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var JwtConfiguration |
||
| 18 | */ |
||
| 19 | private $config; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var Constraint[] |
||
| 23 | */ |
||
| 24 | private $constraints; |
||
| 25 | |||
| 26 | public function __construct(JwtConfiguration $config, Clock $clock, array $issuers = null, string $audience = null) |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | public function isValid(string $jwt): bool |
||
| 47 | } |
||
| 48 | |||
| 49 | public function parse(string $jwt): Token |
||
| 50 | { |
||
| 51 | return Token::fromClaims($this->parseJwt($jwt)->claims()->all()); |
||
| 52 | } |
||
| 53 | |||
| 54 | private function addConstraint(Constraint $constraint): self |
||
| 55 | { |
||
| 56 | $this->constraints[] = $constraint; |
||
| 57 | |||
| 58 | return $this; |
||
| 59 | } |
||
| 60 | |||
| 61 | private function parseJwt(string $jwt): JwtToken |
||
| 64 | } |
||
| 65 | } |
||
| 66 |