| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class ClassCommentProcessor implements PreparationProcessorInterface |
||
| 20 | { |
||
| 21 | 3 | public function process(iterable $classDef, ClassDefinition $classDefinition, array $classList): void |
|
| 22 | { |
||
| 23 | 3 | $opts = [ |
|
| 24 | 3 | self::DEPRECATED => '@deprecated', |
|
| 25 | 3 | self::DESCRIPTION => null, |
|
| 26 | 3 | ]; |
|
| 27 | |||
| 28 | 3 | foreach ($opts as $opt => $prefix) { |
|
| 29 | 3 | $commentValue = $classDef[$opt] ?? false; |
|
| 30 | 3 | if (!$commentValue) { |
|
| 31 | 1 | continue; |
|
| 32 | } |
||
| 33 | |||
| 34 | 3 | $this->addComment($classDefinition, $commentValue, $prefix); |
|
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param ClassDefinition $classDefinition |
||
| 40 | * @param string $comment |
||
| 41 | * @param string|null $commentPrefix |
||
| 42 | * |
||
| 43 | * @return void |
||
| 44 | */ |
||
| 45 | 3 | protected function addComment(ClassDefinition $classDefinition, string $comment, ?string $commentPrefix): void |
|
| 50 | } |
||
| 51 | } |
||
| 52 |