Apply "SlevomatCodingStandard.ControlStructures.EarlyExit"

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
Henrique Moody 2019-02-09 12:27:11 +01:00
parent 7e3bf36f8d
commit d72d247ddc
No known key found for this signature in database
GPG key ID: 221E9281655813A6
3 changed files with 12 additions and 3 deletions

View file

@ -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;

View file

@ -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;
}

View file

@ -45,6 +45,7 @@
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition" />
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch" />
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit" />
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator" />