Conditions | 5 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 5.0488 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
47 | 9 | public function classifyComment(string $token): ?CommentTypeInterface |
|
48 | { |
||
49 | 9 | foreach ($this->commentTypes as $commentType) { |
|
50 | 9 | if (! $commentType->matchesPattern($token)) { |
|
51 | 7 | continue; |
|
52 | } |
||
53 | if ( |
||
54 | 9 | empty($this->allowedTypes) |
|
55 | 9 | || in_array($commentType->getName(), $this->allowedTypes, true) |
|
56 | ) { |
||
57 | 9 | return $commentType; |
|
58 | } |
||
59 | } |
||
60 | return null; |
||
61 | } |
||
63 |