Skip to content

Commit f6f59ec

Browse files
committed
RuntimeReflectionFunctionRule: cheap checks first
1 parent 8e90347 commit f6f59ec

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Rules/Api/RuntimeReflectionFunctionRule.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public function processNode(Node $node, Scope $scope): array
3535
return [];
3636
}
3737

38+
if (!$scope->isInClass()) {
39+
return [];
40+
}
41+
3842
if (!$this->reflectionProvider->hasFunction($node->name, $scope)) {
3943
return [];
4044
}
@@ -50,10 +54,6 @@ public function processNode(Node $node, Scope $scope): array
5054
return [];
5155
}
5256

53-
if (!$scope->isInClass()) {
54-
return [];
55-
}
56-
5757
$classReflection = $scope->getClassReflection();
5858
$hasPhpStanInterface = false;
5959
foreach (array_keys($classReflection->getInterfaces()) as $interfaceName) {

0 commit comments

Comments
 (0)