The doc comment array<array-key, CommentTypeInterface> at position 2 could not be parsed: Unknown type name 'array-key' at position 2 in array<array-key, CommentTypeInterface>.
Loading history...
10
private array $commentTypes;
11
12
13
public function __construct()
13
{
14
13
$this->commentTypes = [
15
13
new TodoComment(),
16
13
new FixMeComment(),
17
13
new RegularComment(),
18
13
new LicenseComment(),
19
13
new DocBlockComment(),
20
13
];
21
}
22
23
2
public function getCommentType(string $name): ?CommentTypeInterface
24
{
25
2
foreach ($this->commentTypes as $commentType) {
26
2
if ($commentType->getName() === $name) {
27
2
return $commentType;
28
}
29
}
30
2
return null;
31
}
32
33
10
public function classifyComment(string $token): ?CommentTypeInterface