Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function check(JWTInterface $jwt) |
||
40 | { |
||
41 | $claims = json_decode($jwt->getPayload(), true); |
||
42 | if (!is_array($claims)) { |
||
43 | throw new \InvalidArgumentException('The payload is does not contain claims.'); |
||
44 | } |
||
45 | |||
46 | foreach ($this->checkers as $claim => $checker) { |
||
47 | if (array_key_exists($claim, $claims)) { |
||
48 | $checker->checkClaim($claims[$claim]); |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 |