File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 4
4
"type" : " library" ,
5
5
"require" : {
6
6
"php" : " ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" ,
7
- "phpstan/phpstan" : " ^1.6"
7
+ "phpstan/phpstan" : " ^1.6|^2.0 "
8
8
},
9
9
"require-dev" : {
10
10
"phpunit/phpunit" : " ^9.0" ,
Original file line number Diff line number Diff line change 8
8
use PhpParser \Node \Stmt \Goto_ ;
9
9
use PHPStan \Analyser \Scope ;
10
10
use PHPStan \Rules \Rule ;
11
+ use PHPStan \Rules \RuleErrorBuilder ;
11
12
12
13
/** @implements Rule<Goto_> */
13
14
final class NoGotoPhpstanRule implements Rule
@@ -19,6 +20,10 @@ public function getNodeType(): string
19
20
20
21
public function processNode (Node $ node , Scope $ scope ): array
21
22
{
22
- return ['goto statement is not allowed. Label: ' .$ node ->name ->toString ()];
23
+ return [
24
+ RuleErrorBuilder::message ('goto statement is not allowed. Label: ' .$ node ->name ->toString ())
25
+ ->identifier ('test.noGoto ' )
26
+ ->build (),
27
+ ];
23
28
}
24
29
}
You can’t perform that action at this time.
0 commit comments