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 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function code(int $indentation = 0) : string |
||
55 | |||
56 | /** |
||
57 | * Format comments code into single line comment. |
||
58 | * |
||
59 | * @param string $indentation Indentation string |
||
60 | * |
||
61 | * @return string Single line comments code |
||
62 | */ |
||
63 | protected function formatSingleLine(string $indentation) |
||
67 | |||
68 | /** |
||
69 | * Format comments code into multi line comment. |
||
70 | * |
||
71 | * @param string $indentation Indentation string |
||
72 | * |
||
73 | * @return string Multi-line comments code |
||
74 | */ |
||
75 | protected function formatMultiLine(string $indentation) |
||
88 | } |
||
89 |