Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function check(Authorization $authorization): Authorization |
||
34 | { |
||
35 | try { |
||
36 | if ($authorization->hasQueryParam('display') && !in_array($authorization->getQueryParam('display'), $this->getAllowedDisplayValues())) { |
||
37 | throw new OAuth2AuthorizationException(400, OAuth2Exception::ERROR_INVALID_REQUEST, sprintf('Invalid parameter "display". Allowed values are %s', implode(', ', $this->getAllowedDisplayValues())), $authorization); |
||
38 | } |
||
39 | |||
40 | return $authorization; |
||
41 | } catch (\InvalidArgumentException $e) { |
||
42 | throw new OAuth2AuthorizationException(400, OAuth2Exception::ERROR_INVALID_REQUEST, $e->getMessage(), $authorization, $e); |
||
43 | } |
||
44 | } |
||
45 | |||
59 |