Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/Rules/PHPUnit/DataProviderDataRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use PHPStan\Analyser\Scope;
use PHPStan\BetterReflection\Reflection\ReflectionMethod;
use PHPStan\Node\Expr\TypeExpr;
use PHPStan\Rules\Rule;
use PHPStan\Rules\MultipleNodeTypesRule;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use function array_slice;
Expand All @@ -15,9 +15,9 @@
use const PHP_INT_MAX;

/**
* @implements Rule<Node>
* @implements MultipleNodeTypesRule<Node>
*/
class DataProviderDataRule implements Rule
class DataProviderDataRule implements MultipleNodeTypesRule
{

private TestMethodsHelper $testMethodsHelper;
Expand All @@ -37,6 +37,11 @@ public function __construct(
$this->PHPUnitVersion = $PHPUnitVersion;
}

public function getNodeTypes(): array
{
return [Node\Stmt\Return_::class, Node\Expr\Yield_::class, Node\Expr\YieldFrom::class];
}

public function getNodeType(): string
{
return Node::class;
Expand Down
Loading