| @@ 39-46 (lines=8) @@ | ||
| 36 | * @throws ValidationException |
|
| 37 | * thrown if the amount of parameters is not equal two or the first parameter is not a Validator |
|
| 38 | */ |
|
| 39 | protected function checkParameters(array $parameters) { |
|
| 40 | if (count($parameters) !== 2) { |
|
| 41 | throw new ValidationException('"collection" expects two parameters.'); |
|
| 42 | } |
|
| 43 | if (!($parameters[0] instanceof Validator)) { |
|
| 44 | throw new ValidationException('"collection" expects the first parameter to be an instance of a Validator.'); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * Checks whether the given values are of the expected array. |
|
| @@ 38-45 (lines=8) @@ | ||
| 35 | * @throws ValidationException |
|
| 36 | * thrown if the amount of parameters is less than three or the first parameter is not a Validator |
|
| 37 | */ |
|
| 38 | protected function checkParameters($parameters) { |
|
| 39 | if (count($parameters) < 3) { |
|
| 40 | throw new ValidationException('"or" expects at least 3 parameters.'); |
|
| 41 | } |
|
| 42 | if (!($parameters[0] instanceof Validator)) { |
|
| 43 | throw new ValidationException('"or" expects the first parameter to be a Validator or a subclass of it.'); |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * {@inheritdoc} |
|