Skip to content

Commit 7afec64

Browse files
committed
fix bug
1 parent 6f616dd commit 7afec64

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Rules/Variables/DisallowMutationRule.php

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function processNode(Node $node, Scope $scope): array
3939
case 'Expr_Array':
4040
$containsTypedItems = collect($node->var->items)
4141
->map(fn($item) => $item->value->name)
42+
->filter(fn($name) => !is_null($name))
4243
->contains(fn($name) => $scope->hasVariableType($name)->yes());
4344
return $containsTypedItems ? [$errorMessage] : [];
4445

0 commit comments

Comments
 (0)