Total Complexity | 7 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | trait CommentTrait |
||
20 | { |
||
21 | /** |
||
22 | * @var Comment |
||
23 | */ |
||
24 | private $docComment; |
||
25 | |||
26 | /** |
||
27 | * Get associated file comment. |
||
28 | * |
||
29 | * @return Comment |
||
30 | */ |
||
31 | public function getComment(): Comment |
||
32 | { |
||
33 | return $this->docComment; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Set comment value. |
||
38 | * |
||
39 | * @param string|array $comment |
||
40 | * |
||
41 | * @return $this |
||
42 | */ |
||
43 | public function setComment($comment): self |
||
44 | { |
||
45 | if (!empty($comment)) { |
||
46 | if (is_array($comment)) { |
||
47 | $this->docComment->setLines($comment); |
||
48 | } elseif (is_string($comment)) { |
||
|
|||
49 | $this->docComment->setString($comment); |
||
50 | } |
||
51 | } |
||
52 | |||
53 | return $this; |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Init comment value. |
||
58 | * |
||
59 | * @param string|array $comment |
||
60 | */ |
||
61 | private function initComment($comment): void |
||
68 | } |
||
69 | } |
||
70 |