Skip to content

Commit a978aa8

Browse files
committed
fix invalid call on null in yield
1 parent 5fcf01d commit a978aa8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Rules/PHPUnit/DataProviderDataRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public function processNode(Node $node, Scope $scope): array
6161
}
6262
}
6363
} elseif ($node instanceof Node\Expr\Yield_) {
64+
if ($node->value === null) {
65+
return [];
66+
}
67+
6468
$exprType = $scope->getType($node->value);
6569
if (!$exprType->isConstantArray()->yes()) {
6670
return [];

0 commit comments

Comments
 (0)