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 2
2
3
3
namespace PHPStan \Rules \Playground ;
4
4
5
- use PhpParser \Comment ;
6
5
use PhpParser \Node ;
7
6
use PHPStan \Analyser \Scope ;
8
7
use PHPStan \Node \VirtualNode ;
9
8
use PHPStan \Rules \Rule ;
10
9
use PHPStan \Rules \RuleErrorBuilder ;
11
- use PHPStan \ShouldNotHappenException ;
12
10
use function str_contains ;
13
11
use function str_starts_with ;
14
12
@@ -29,14 +27,10 @@ public function processNode(Node $node, Scope $scope): array
29
27
return [];
30
28
}
31
29
32
- $ comments = $ node ->getAttribute ( ' comments ' , [] );
30
+ $ comments = $ node ->getComments ( );
33
31
34
32
$ errors = [];
35
33
foreach ($ comments as $ comment ) {
36
- if (!$ comment instanceof Comment) {
37
- throw new ShouldNotHappenException ();
38
- }
39
-
40
34
if (!str_contains ($ comment ->getText (), '@ ' )) {
41
35
continue ;
42
36
}
You can’t perform that action at this time.
0 commit comments