Skip to content

Commit 8978e8e

Browse files
authored
Fix code style issues (#810)
1 parent 564999e commit 8978e8e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

rules/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,47 +51,47 @@ public function getNodeTypes(): array
5151

5252
public function refactor(Node $node): ?Node
5353
{
54-
if (!$node instanceof New_) {
54+
if (! $node instanceof New_) {
5555
return null;
5656
}
5757

5858
// Match classes starting with Symfony\Component\Validator\Constraints\
59-
if (!$node->class instanceof FullyQualified && !$node->class instanceof Name) {
59+
if (! $node->class instanceof FullyQualified && ! $node->class instanceof Name) {
6060
return null;
6161
}
6262

6363
$className = $this->getName($node->class);
64-
if (!is_string($className)) {
64+
if (! is_string($className)) {
6565
return null;
6666
}
6767

68-
if (!str_starts_with($className, 'Symfony\Component\Validator\Constraints\\')) {
68+
if (! str_starts_with($className, 'Symfony\Component\Validator\Constraints\\')) {
6969
return null;
7070
}
7171

7272
if (
73-
0 === count($node->args) ||
74-
!$node->args[0] instanceof Arg ||
75-
!$node->args[0]->value instanceof Array_
73+
count($node->args) === 0 ||
74+
! $node->args[0] instanceof Arg ||
75+
! $node->args[0]->value instanceof Array_
7676
) {
7777
return null;
7878
}
7979

8080
$argName = $node->args[0]->name;
81-
if (null !== $argName && 'options' !== $argName->name) {
81+
if ($argName !== null && $argName->name !== 'options') {
8282
return null;
8383
}
8484

8585
$array = $node->args[0]->value;
8686
$namedArgs = [];
8787

8888
foreach ($array->items as $item) {
89-
if (!$item instanceof ArrayItem || null === $item->key) {
89+
if (! $item instanceof ArrayItem || $item->key === null) {
9090
continue;
9191
}
9292

9393
$keyValue = $this->valueResolver->getValue($item->key);
94-
if (!is_string($keyValue)) {
94+
if (! is_string($keyValue)) {
9595
continue;
9696
}
9797

0 commit comments

Comments
 (0)