Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed Sep 1, 2023
1 parent ae58fcd commit 45bfabb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/PHPStan/Rules/Methods/VirtualNullsafeMethodCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Testing\RuleTestCase;

/**
Expand All @@ -14,9 +15,12 @@
class VirtualNullsafeMethodCallTest extends RuleTestCase
{

/**
* @return Rule<MethodCall>
*/
protected function getRule(): Rule
{
return new class implements Rule {
return new /** @implements Rule<MethodCall> */ class implements Rule {

public function getNodeType(): string
{
Expand All @@ -26,10 +30,10 @@ public function getNodeType(): string
public function processNode(Node $node, Scope $scope): array
{
if ($node->getAttribute('virtualNullsafeMethodCall') === true) {
return ['Nullable method call detected'];
return [RuleErrorBuilder::message('Nullable method call detected')->identifier('')->build()];
}

return ['Regular method call detected'];
return [RuleErrorBuilder::message('Regular method call detected')->identifier('')->build()];
}

};
Expand Down

0 comments on commit 45bfabb

Please sign in to comment.