1 | <?php |
||
14 | class CodeGeneratorConfig { |
||
15 | |||
16 | protected $options; |
||
17 | |||
18 | /** |
||
19 | * Creates a new configuration for code generator |
||
20 | * |
||
21 | * @see https://php-code-generator.readthedocs.org/en/latest/generator.html |
||
22 | * @param array $options |
||
23 | */ |
||
24 | 45 | public function __construct(array $options = []) { |
|
29 | |||
30 | 45 | protected function configureOptions(OptionsResolver $resolver) { |
|
57 | |||
58 | /** |
||
59 | * Returns whether docblocks should be generated |
||
60 | * |
||
61 | 35 | * @return bool `true` if they will be generated and `false` if not |
|
62 | 35 | */ |
|
63 | public function getGenerateDocblock() { |
||
66 | |||
67 | /** |
||
68 | * Sets whether docblocks should be generated |
||
69 | * |
||
70 | * @param bool $generate `true` if they will be generated and `false` if not |
||
71 | 1 | * @return $this |
|
72 | 1 | */ |
|
73 | 1 | public function setGenerateDocblock($generate) { |
|
80 | |||
81 | /** |
||
82 | * Returns whether empty docblocks are generated |
||
83 | * |
||
84 | 35 | * @return bool `true` if they will be generated and `false` if not |
|
85 | 35 | */ |
|
86 | public function getGenerateEmptyDocblock() { |
||
89 | |||
90 | /** |
||
91 | * Sets whether empty docblocks are generated |
||
92 | * |
||
93 | * @param bool $generate `true` if they will be generated and `false` if not |
||
94 | 1 | * @return $this |
|
95 | 1 | */ |
|
96 | 1 | public function setGenerateEmptyDocblock($generate) { |
|
103 | |||
104 | /** |
||
105 | * Returns whether scalar type hints will be generated for method parameters (PHP 7) |
||
106 | * |
||
107 | 14 | * @return bool `true` if they will be generated and `false` if not |
|
108 | 14 | */ |
|
109 | public function getGenerateScalarTypeHints() { |
||
112 | |||
113 | /** |
||
114 | * Returns whether PSR-code compatible will be generated |
||
115 | * |
||
116 | 16 | * @return bool `true` if they will be generated and `false` if not |
|
117 | 16 | */ |
|
118 | public function getGeneratePsrCode() { |
||
121 | |||
122 | /** |
||
123 | * Returns whether sorting is enabled |
||
124 | * |
||
125 | 16 | * @return bool `true` if it is enabled and `false` if not |
|
126 | 16 | */ |
|
127 | public function isSortingEnabled() { |
||
130 | |||
131 | /** |
||
132 | * Returns the use statement sorting |
||
133 | * |
||
134 | 15 | * @return string|bool|Comparator|\Closure |
|
135 | 15 | */ |
|
136 | public function getUseStatementSorting() { |
||
139 | |||
140 | /** |
||
141 | * Returns the constant sorting |
||
142 | * |
||
143 | 14 | * @return string|bool|Comparator|\Closure |
|
144 | 14 | */ |
|
145 | public function getConstantSorting() { |
||
148 | |||
149 | /** |
||
150 | * Returns the property sorting |
||
151 | * |
||
152 | 16 | * @return string|bool|Comparator|\Closure |
|
153 | 16 | */ |
|
154 | public function getPropertySorting() { |
||
157 | |||
158 | /** |
||
159 | * Returns the method sorting |
||
160 | * |
||
161 | * @return string|bool|Comparator|\Closure |
||
162 | 1 | */ |
|
163 | 1 | public function getMethodSorting() { |
|
166 | |||
167 | /** |
||
168 | * Sets whether scalar type hints will be generated for method parameters (PHP 7) |
||
169 | * |
||
170 | * @param bool $generate `true` if they will be generated and `false` if not |
||
171 | * @return $this |
||
172 | 19 | */ |
|
173 | 19 | public function setGenerateScalarTypeHints($generate) { |
|
177 | |||
178 | /** |
||
179 | * @param bool $generate `true` if they will be generated and `false` if not |
||
180 | * @return $this |
||
181 | */ |
||
182 | 1 | public function setGeneratePsrCode($generate) { |
|
186 | |||
187 | /** |
||
188 | * Returns whether return type hints will be generated for method parameters (PHP 7) |
||
189 | * |
||
190 | * @return bool `true` if they will be generated and `false` if not |
||
191 | */ |
||
192 | public function getGenerateReturnTypeHints() { |
||
195 | 1 | ||
196 | /** |
||
197 | * Sets whether return type hints will be generated for method parameters (PHP 7) |
||
198 | * |
||
199 | * @param bool $generate `true` if they will be generated and `false` if not |
||
200 | * @return $this |
||
201 | */ |
||
202 | public function setGenerateReturnTypeHints($generate) { |
||
206 | 1 | ||
207 | /** |
||
208 | * Returns whether sorting is enabled |
||
209 | * |
||
210 | * @param $enabled bool `true` if it is enabled and `false` if not |
||
211 | * @return $this |
||
212 | */ |
||
213 | public function setSortingEnabled($enabled) { |
||
217 | 1 | ||
218 | /** |
||
219 | * Returns the use statement sorting |
||
220 | * |
||
221 | * @param $sorting string|bool|Comparator|\Closure |
||
222 | * @return $this |
||
223 | */ |
||
224 | public function setUseStatementSorting($sorting) { |
||
228 | 1 | ||
229 | /** |
||
230 | * Returns the constant sorting |
||
231 | * |
||
232 | * @param $sorting string|bool|Comparator|\Closure |
||
233 | * @return $this |
||
234 | */ |
||
235 | public function setConstantSorting($sorting) { |
||
239 | 1 | ||
240 | /** |
||
241 | * Returns the property sorting |
||
242 | * |
||
243 | * @param $sorting string|bool|Comparator|\Closure |
||
244 | * @return $this |
||
245 | */ |
||
246 | public function setPropertySorting($sorting) { |
||
250 | |||
251 | /** |
||
252 | * Returns the method sorting |
||
253 | * |
||
254 | * @param $sorting string|bool|Comparator|\Closure |
||
255 | * @return $this |
||
256 | */ |
||
257 | public function setMethodSorting($sorting) { |
||
261 | } |
||
262 |