Apply "SlevomatCodingStandard.ControlStructures.AssignmentInCondition"

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

View file

@ -254,7 +254,8 @@ final class Factory
$values[$property->getName()] = $propertyValue;
}
if (($parentReflection = $reflection->getParentClass())) {
$parentReflection = $reflection->getParentClass();
if (false !== $parentReflection) {
return $values + $this->extractPropertiesValues($validatable, $parentReflection);
}

View file

@ -50,11 +50,13 @@ final class Cnh extends AbstractRule
$s2 += (int) $input[$c] * (10 - $p);
}
if ($input[9] != (($dv1 = $s1 % 11) > 9) ? 0 : $dv1) {
$dv1 = $s1 % 11;
if ($input[9] != ($dv1 > 9) ? 0 : $dv1) {
return false;
}
if ($input[10] != (((($dv2 = ($s2 % 11) - (($dv1 > 9) ? 2 : 0)) < 0) ? $dv2 + 11 : $dv2) > 9) ? 0 : $dv2) {
$dv2 = ($s2 % 11) - (($dv1 > 9) ? 2 : 0);
if ($input[10] != ((($dv2 < 0) ? $dv2 + 11 : $dv2) > 9) ? 0 : $dv2) {
return false;
}

View file

@ -89,7 +89,9 @@ class Domain extends AbstractComposite
}
}
if (count($parts = explode('.', (string) $input)) < 2
$parts = explode('.', (string) $input);
if (count($parts) < 2
|| !$this->tld->validate(array_pop($parts))) {
return false;
}
@ -113,7 +115,8 @@ class Domain extends AbstractComposite
$this->collectAssertException($exceptions, $chk, $input);
}
if (count($parts = explode('.', (string) $input)) >= 2) {
$parts = explode('.', (string) $input);
if (count($parts) >= 2) {
$this->collectAssertException($exceptions, $this->tld, array_pop($parts));
}
@ -152,7 +155,8 @@ class Domain extends AbstractComposite
$chk->check($input);
}
if (count($parts = explode('.', $input)) >= 2) {
$parts = explode('.', $input);
if (count($parts) >= 2) {
$this->tld->check(array_pop($parts));
}

View file

@ -43,6 +43,7 @@
<property name="linesCountBeforeFirstUse" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition" />
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch" />
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" />