Skip to content

Commit aafaf8f

Browse files
committed
simplify
1 parent 30e27db commit aafaf8f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Rules/PHPUnit/DataProviderDataRule.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ public function processNode(Node $node, Scope $scope): array
4747
return [];
4848
}
4949

50+
$constantArrays = [];
5051
if ($node instanceof Node\Stmt\Return_ || $node instanceof Node\Expr\YieldFrom) {
5152
if ($node->expr === null) {
5253
return [];
5354
}
5455

55-
$constantArrays = [];
5656
$exprType = $scope->getType($node->expr);
5757
$exprConstArrays = $exprType->getConstantArrays();
5858
foreach ($exprConstArrays as $constArray) {
@@ -72,13 +72,7 @@ public function processNode(Node $node, Scope $scope): array
7272
}
7373

7474
$exprType = $scope->getType($node->value);
75-
if (!$exprType->isConstantArray()->yes()) {
76-
return [];
77-
}
78-
7975
$constantArrays = $exprType->getConstantArrays();
80-
} else {
81-
return [];
8276
}
8377

8478
if ($constantArrays === []) {

0 commit comments

Comments
 (0)