1 | <?php declare(strict_types = 1); |
||
13 | class CommentsGenerator extends AbstractGenerator |
||
14 | { |
||
15 | use CodeTrait; |
||
16 | |||
17 | /** |
||
18 | * Set var comment line. |
||
19 | * |
||
20 | * @param string $type Type |
||
21 | * @param string|null $description Description |
||
22 | * |
||
23 | * @return CommentsGenerator |
||
24 | */ |
||
25 | public function defVar(string $type, string $description = null) : CommentsGenerator |
||
29 | |||
30 | /** |
||
31 | * Set param comment line. |
||
32 | * |
||
33 | * @param string $name Argument name |
||
34 | * @param string $type Argument type |
||
35 | * @param string|null $description Argument description |
||
36 | * |
||
37 | * @return CommentsGenerator |
||
38 | */ |
||
39 | public function defParam(string $name, string $type, string $description = null) : CommentsGenerator |
||
43 | |||
44 | /** |
||
45 | * Set return comment line. |
||
46 | * |
||
47 | * @param string $type Return type |
||
48 | * @param string|null $description Return description |
||
49 | * |
||
50 | * @return CommentsGenerator |
||
51 | */ |
||
52 | public function defReturn(string $type, string $description = null) : CommentsGenerator |
||
56 | |||
57 | /** |
||
58 | * Set method comment line. |
||
59 | * |
||
60 | * @param string $name Method name |
||
61 | * @param string $returnType Method return type |
||
62 | * @param array $arguments Method arguments |
||
63 | * |
||
64 | * @return CommentsGenerator |
||
65 | * @internal param null|string $description Argument description |
||
66 | * |
||
67 | */ |
||
68 | public function defMethod(string $name, string $returnType, array $arguments = []) : CommentsGenerator |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | public function code(int $indentation = 0) : string |
||
84 | |||
85 | /** |
||
86 | * Format comments code into single line comment. |
||
87 | * |
||
88 | * @param string $indentation Indentation string |
||
89 | * |
||
90 | * @return string Single line comments code |
||
91 | */ |
||
92 | protected function formatSingleLine(string $indentation) |
||
96 | |||
97 | /** |
||
98 | * Format comments code into multi line comment. |
||
99 | * |
||
100 | * @param string $indentation Indentation string |
||
101 | * |
||
102 | * @return string Multi-line comments code |
||
103 | */ |
||
104 | protected function formatMultiLine(string $indentation) |
||
117 | } |
||
118 |