We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa70750 commit 6775b34Copy full SHA for 6775b34
1 file changed
src/Rules/Playground/PhpdocCommentRule.php
@@ -2,13 +2,11 @@
2
3
namespace PHPStan\Rules\Playground;
4
5
-use PhpParser\Comment;
6
use PhpParser\Node;
7
use PHPStan\Analyser\Scope;
8
use PHPStan\Node\VirtualNode;
9
use PHPStan\Rules\Rule;
10
use PHPStan\Rules\RuleErrorBuilder;
11
-use PHPStan\ShouldNotHappenException;
12
use function str_contains;
13
use function str_starts_with;
14
@@ -29,14 +27,10 @@ public function processNode(Node $node, Scope $scope): array
29
27
return [];
30
28
}
31
32
- $comments = $node->getAttribute('comments', []);
+ $comments = $node->getComments();
33
34
$errors = [];
35
foreach ($comments as $comment) {
36
- if (!$comment instanceof Comment) {
37
- throw new ShouldNotHappenException();
38
- }
39
-
40
if (!str_contains($comment->getText(), '@')) {
41
continue;
42
0 commit comments