mirror of
https://github.com/Respect/Validation.git
synced 2024-06-10 17:52:18 +02:00
Apply "SlevomatCodingStandard.ControlStructures.AssignmentInCondition"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
cb24cc97d2
commit
7e3bf36f8d
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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" />
|
||||
|
|
Loading…
Reference in a new issue