Skip to content

Commit 1d3db54

Browse files
committed
new TypeExpr(new ObjectType())
1 parent a1dad84 commit 1d3db54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Rules/PHPUnit/DataProviderDataRule.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PHPStan\Reflection\Php\PhpMethodFromParserNodeReflection;
99
use PHPStan\Rules\Rule;
1010
use PHPStan\Type\Constant\ConstantArrayType;
11+
use PHPStan\Type\ObjectType;
1112
use PHPUnit\Framework\TestCase;
1213
use function array_slice;
1314
use function count;
@@ -54,7 +55,7 @@ public function processNode(Node $node, Scope $scope): array
5455
$constantArrays = [];
5556
foreach ($constArrays as $constArray) {
5657
foreach ($constArray->getValueTypes() as $valueType) {
57-
foreach($valueType->getConstantArrays() as $constValueArray) {
58+
foreach ($valueType->getConstantArrays() as $constValueArray) {
5859
$constantArrays[] = $constValueArray;
5960
}
6061
}
@@ -129,9 +130,8 @@ public function processNode(Node $node, Scope $scope): array
129130
$args = array_slice($args, 0, min($testMethod->getNumberOfParameters(), $maxNumberOfParameters));
130131
}
131132

132-
$var = new Node\Expr\New_(new Node\Name($classReflection->getName()));
133133
$scope->invokeNodeCallback(new Node\Expr\MethodCall(
134-
$var,
134+
new TypeExpr(new ObjectType($classReflection->getName())),
135135
$testMethod->getName(),
136136
$args,
137137
['startLine' => $node->getStartLine()],

0 commit comments

Comments
 (0)