| Conditions | 4 |
| Paths | 7 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function check(Authorization $authorization): Authorization |
||
| 26 | { |
||
| 27 | try { |
||
| 28 | if ($authorization->hasQueryParam('claims')) { |
||
| 29 | $decoded = json_decode($authorization->getQueryParam('claims'), true); |
||
| 30 | if (!is_array($decoded)) { |
||
| 31 | throw new \InvalidArgumentException('Invalid "claims" parameter.'); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $authorization->withClaims($decoded); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $authorization; |
||
| 38 | } catch (\InvalidArgumentException $e) { |
||
| 39 | throw new OAuth2AuthorizationException(400, OAuth2Message::ERROR_INVALID_REQUEST, $e->getMessage(), $authorization, $e); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |