| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function check(Authorization $authorization): Authorization |
||
| 30 | { |
||
| 31 | try { |
||
| 32 | if (false !== strpos($authorization->getQueryParam('response_type'), 'id_token') && !$authorization->hasQueryParam('nonce')) { |
||
| 33 | throw new \InvalidArgumentException('The parameter "nonce" is mandatory when the response type "id_token" is used.'); |
||
| 34 | } |
||
| 35 | |||
| 36 | return $authorization; |
||
| 37 | } catch (\InvalidArgumentException $e) { |
||
| 38 | throw new OAuth2AuthorizationException(400, OAuth2Message::ERROR_INVALID_REQUEST, $e->getMessage(), $authorization, $e); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | } |
||
| 42 |