diff --git a/library/Exceptions/NestedValidationException.php b/library/Exceptions/NestedValidationException.php index bafda01a..fed4f724 100644 --- a/library/Exceptions/NestedValidationException.php +++ b/library/Exceptions/NestedValidationException.php @@ -232,9 +232,15 @@ class NestedValidationException extends ValidationException implements IteratorA { while (count($ids) > 0) { $id = array_shift($ids); - if (isset($templates[$id]) && is_array($templates[$id])) { - $templates = $templates[$id]; + if (!isset($templates[$id])) { + continue; } + + if (!is_array($templates[$id])) { + continue; + } + + $templates = $templates[$id]; } return $templates; diff --git a/library/Exceptions/SizeException.php b/library/Exceptions/SizeException.php index 413cbe95..9ea51945 100644 --- a/library/Exceptions/SizeException.php +++ b/library/Exceptions/SizeException.php @@ -47,7 +47,9 @@ class SizeException extends NestedValidationException { if (!$this->getParam('minValue')) { return self::GREATER; - } elseif (!$this->getParam('maxValue')) { + } + + if (!$this->getParam('maxValue')) { return self::LOWER; } diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 3505b15b..03cdb143 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -45,6 +45,7 @@ +