Skip to content

Commit 21740cb

Browse files
committed
moved cheapest check to the front
1 parent d6c11be commit 21740cb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Rules/PHPUnit/DataProviderDataRule.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ public function getNodeType(): string
4040

4141
public function processNode(Node $node, Scope $scope): array
4242
{
43-
if ($scope->getFunction() === null) {
44-
return [];
45-
}
46-
if ($scope->isInAnonymousFunction()) {
47-
return [];
48-
}
49-
5043
if (
5144
!$node instanceof Node\Stmt\Return_
5245
&& !$node instanceof Node\Expr\Yield_
@@ -55,6 +48,13 @@ public function processNode(Node $node, Scope $scope): array
5548
return [];
5649
}
5750

51+
if ($scope->getFunction() === null) {
52+
return [];
53+
}
54+
if ($scope->isInAnonymousFunction()) {
55+
return [];
56+
}
57+
5858
$arraysTypes = $this->buildArrayTypesFromNode($node, $scope);
5959
if ($arraysTypes === []) {
6060
return [];

0 commit comments

Comments
 (0)