Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
20 | final class DisplayParameterChecker implements ParameterChecker |
||
21 | { |
||
22 | public const DISPLAY_PAGE = 'page'; |
||
23 | |||
24 | public const DISPLAY_POPUP = 'popup'; |
||
25 | |||
26 | public const DISPLAY_TOUCH = 'touch'; |
||
27 | |||
28 | public const DISPLAY_WAP = 'wap'; |
||
29 | |||
30 | public function check(AuthorizationRequest $authorization): void |
||
31 | { |
||
32 | if ($authorization->hasQueryParam('display')) { |
||
33 | Assertion::inArray($authorization->getQueryParam('display'), $this->getAllowedDisplayValues(), sprintf('Invalid parameter "display". Allowed values are %s', implode(', ', $this->getAllowedDisplayValues()))); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return string[] |
||
39 | */ |
||
40 | private function getAllowedDisplayValues(): array |
||
47 | ]; |
||
48 | } |
||
50 |