Skip to content

Commit f4c4ec5

Browse files
committed
Fix check on variable assign inside Superglobals
1 parent 3eeb763 commit f4c4ec5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Rules/Superglobals/SuperglobalAssignRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ private function processVariableExpr(Node $node, Scope $scope): array
145145
return [];
146146
}
147147

148+
if ($scope->isInClass() && $scope->getClassReflection()->getName() === Superglobals::class) {
149+
return [];
150+
}
151+
148152
$exprType = $scope->getType($node->expr);
149153

150154
if (! $exprType->isArray()->yes()) {

0 commit comments

Comments
 (0)