Validate all rich objects not only the used ones

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/12624/head
Joas Schilling 2018-11-23 12:38:07 +07:00
parent 75c3737054
commit 695e60228d
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 8 additions and 2 deletions

@ -71,11 +71,17 @@ class Validator implements IValidator {
foreach ($matches[1] as $parameter) {
if (!isset($parameters[$parameter])) {
throw new InvalidObjectExeption('Parameter is undefined');
} else {
$this->validateParameter($parameters[$parameter]);
}
}
}
foreach ($parameters as $parameter) {
if (!\is_array($parameter)) {
throw new InvalidObjectExeption('Parameter is malformed');
}
$this->validateParameter($parameter);
}
}
/**