| 1 | <?php |
||
| 8 | class ArticlesListParametersValidator implements ValidatorInterface |
||
| 9 | { |
||
| 10 | private $allowedMethodsParameters = [ |
||
| 11 | 'desked' => [ |
||
| 12 | 'areaLimit', |
||
| 13 | 'offset', |
||
| 14 | 'limit' |
||
| 15 | ], |
||
| 16 | 'auto' => [ |
||
| 17 | 'offset', |
||
| 18 | 'limit', |
||
| 19 | 'since', |
||
| 20 | 'until', |
||
| 21 | 'contentType', |
||
| 22 | 'includeSubsections', |
||
| 23 | 'homeSectionOnly' |
||
| 24 | ] |
||
| 25 | ]; |
||
| 26 | |||
| 27 | private $allowedParameterTypes = [ |
||
| 28 | 'includeSubsections' => 'boolean', |
||
| 29 | 'homeSectionOnly' => 'boolean', |
||
| 30 | ]; |
||
| 31 | |||
| 32 | private $method; |
||
| 33 | |||
| 34 | private $parameters; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param string $method |
||
| 38 | * @param array $parameters |
||
| 39 | */ |
||
| 40 | public function __construct($method, $parameters) |
||
| 45 | |||
| 46 | private function validateBooleanString($value) |
||
| 50 | |||
| 51 | private function entryIsValid($key, $value) |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @return bool |
||
| 66 | */ |
||
| 67 | public function isValid() |
||
| 77 | } |
||
| 78 |