File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change 22
33namespace PHPStan \Rules \Playground ;
44
5- use PhpParser \Comment ;
65use PhpParser \Node ;
76use PHPStan \Analyser \Scope ;
87use PHPStan \Node \VirtualNode ;
98use PHPStan \Rules \Rule ;
109use PHPStan \Rules \RuleErrorBuilder ;
11- use PHPStan \ShouldNotHappenException ;
1210use function str_contains ;
1311use function str_starts_with ;
1412
@@ -29,14 +27,10 @@ public function processNode(Node $node, Scope $scope): array
2927 return [];
3028 }
3129
32- $ comments = $ node ->getAttribute ( ' comments ' , [] );
30+ $ comments = $ node ->getComments ( );
3331
3432 $ errors = [];
3533 foreach ($ comments as $ comment ) {
36- if (!$ comment instanceof Comment) {
37- throw new ShouldNotHappenException ();
38- }
39-
4034 if (!str_contains ($ comment ->getText (), '@ ' )) {
4135 continue ;
4236 }
You can’t perform that action at this time.
0 commit comments