From 0a65d47568b1124891fbbff2cc405b58121b3433 Mon Sep 17 00:00:00 2001 From: Dave Liddament Date: Mon, 16 Dec 2024 18:09:08 +0000 Subject: [PATCH] FIX test by adding returning RuleError instead of string --- tests/Integration/NoGotoPhpstanRule.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Integration/NoGotoPhpstanRule.php b/tests/Integration/NoGotoPhpstanRule.php index ee4622a..f750d11 100644 --- a/tests/Integration/NoGotoPhpstanRule.php +++ b/tests/Integration/NoGotoPhpstanRule.php @@ -8,6 +8,7 @@ use PhpParser\Node\Stmt\Goto_; use PHPStan\Analyser\Scope; use PHPStan\Rules\Rule; +use PHPStan\Rules\RuleErrorBuilder; /** @implements Rule */ final class NoGotoPhpstanRule implements Rule @@ -19,6 +20,10 @@ public function getNodeType(): string public function processNode(Node $node, Scope $scope): array { - return ['goto statement is not allowed. Label: '.$node->name->toString()]; + return [ + RuleErrorBuilder::message('goto statement is not allowed. Label: '.$node->name->toString()) + ->identifier('test.noGoto') + ->build(), + ]; } }