| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | */ |
||
| 29 | public function check(Authorization $authorization): Authorization |
||
| 30 | { |
||
| 31 | try { |
||
| 32 | $authorization = $authorization; |
||
|
|
|||
| 33 | if (false !== strpos($authorization->getQueryParam('response_type'), 'id_token') && !$authorization->hasQueryParam('nonce')) { |
||
| 34 | throw new \InvalidArgumentException('The parameter "nonce" is mandatory when the response type "id_token" is used.'); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $authorization; |
||
| 38 | } catch (\InvalidArgumentException $e) { |
||
| 39 | throw new OAuth2AuthorizationException(400, OAuth2Exception::ERROR_INVALID_REQUEST, $e->getMessage(), $authorization, $e); |
||
| 40 | } |
||
| 41 | } |
||
| 43 |
This checks looks for cases where a variable has been assigned to itself.
This assignement can be removed without consequences.