1 | <?php |
||
15 | class CodeGeneratorConfig { |
||
16 | |||
17 | protected $options; |
||
18 | |||
19 | /** @var Profile */ |
||
20 | protected $profile; |
||
21 | |||
22 | /** |
||
23 | * Creates a new configuration for code generator |
||
24 | * |
||
25 | * @see https://php-code-generator.readthedocs.org/en/latest/generator.html |
||
26 | * @param array $options |
||
27 | */ |
||
28 | 45 | public function __construct(array $options = []) { |
|
34 | |||
35 | 45 | protected function configureOptions(OptionsResolver $resolver) { |
|
64 | |||
65 | /** |
||
66 | * Returns the code style profile |
||
67 | * |
||
68 | * @return Profile |
||
69 | */ |
||
70 | 41 | public function getProfile() { |
|
73 | |||
74 | /** |
||
75 | * Sets the code style profile |
||
76 | * |
||
77 | * @param Profile/string $profile |
||
|
|||
78 | * @return $this |
||
79 | */ |
||
80 | 1 | public function setProfile($profile) { |
|
87 | |||
88 | /** |
||
89 | * Returns whether docblocks should be generated |
||
90 | * |
||
91 | * @return bool `true` if they will be generated and `false` if not |
||
92 | */ |
||
93 | 35 | public function getGenerateDocblock() { |
|
96 | |||
97 | /** |
||
98 | * Sets whether docblocks should be generated |
||
99 | * |
||
100 | * @param bool $generate `true` if they will be generated and `false` if not |
||
101 | * @return $this |
||
102 | */ |
||
103 | 1 | public function setGenerateDocblock($generate) { |
|
110 | |||
111 | /** |
||
112 | * Returns whether empty docblocks are generated |
||
113 | * |
||
114 | * @return bool `true` if they will be generated and `false` if not |
||
115 | */ |
||
116 | 35 | public function getGenerateEmptyDocblock() { |
|
119 | |||
120 | /** |
||
121 | * Sets whether empty docblocks are generated |
||
122 | * |
||
123 | * @param bool $generate `true` if they will be generated and `false` if not |
||
124 | * @return $this |
||
125 | */ |
||
126 | 1 | public function setGenerateEmptyDocblock($generate) { |
|
133 | |||
134 | /** |
||
135 | * Returns whether scalar type hints will be generated for method parameters (PHP 7) |
||
136 | * |
||
137 | * @return bool `true` if they will be generated and `false` if not |
||
138 | */ |
||
139 | 14 | public function getGenerateScalarTypeHints() { |
|
142 | |||
143 | /** |
||
144 | * Returns whether sorting is enabled |
||
145 | * |
||
146 | * @return bool `true` if it is enabled and `false` if not |
||
147 | */ |
||
148 | 16 | public function isSortingEnabled() { |
|
151 | |||
152 | /** |
||
153 | * Returns whether formatting is enalbed |
||
154 | * |
||
155 | * @return bool `true` if it is enabled and `false` if not |
||
156 | */ |
||
157 | 39 | public function isFormattingEnabled() { |
|
160 | |||
161 | /** |
||
162 | * Returns the use statement sorting |
||
163 | * |
||
164 | * @return string|bool|Comparator|\Closure |
||
165 | */ |
||
166 | 16 | public function getUseStatementSorting() { |
|
169 | |||
170 | /** |
||
171 | * Returns the constant sorting |
||
172 | * |
||
173 | * @return string|bool|Comparator|\Closure |
||
174 | */ |
||
175 | 15 | public function getConstantSorting() { |
|
178 | |||
179 | /** |
||
180 | * Returns the property sorting |
||
181 | * |
||
182 | * @return string|bool|Comparator|\Closure |
||
183 | */ |
||
184 | 14 | public function getPropertySorting() { |
|
187 | |||
188 | /** |
||
189 | * Returns the method sorting |
||
190 | * |
||
191 | * @return string|bool|Comparator|\Closure |
||
192 | */ |
||
193 | 16 | public function getMethodSorting() { |
|
196 | |||
197 | /** |
||
198 | * Sets whether scalar type hints will be generated for method parameters (PHP 7) |
||
199 | * |
||
200 | * @param bool $generate `true` if they will be generated and `false` if not |
||
201 | * @return $this |
||
202 | */ |
||
203 | 1 | public function setGenerateScalarTypeHints($generate) { |
|
207 | |||
208 | /** |
||
209 | * Returns whether return type hints will be generated for method parameters (PHP 7) |
||
210 | * |
||
211 | * @return bool `true` if they will be generated and `false` if not |
||
212 | */ |
||
213 | 19 | public function getGenerateReturnTypeHints() { |
|
216 | |||
217 | /** |
||
218 | * Sets whether return type hints will be generated for method parameters (PHP 7) |
||
219 | * |
||
220 | * @param bool $generate `true` if they will be generated and `false` if not |
||
221 | * @return $this |
||
222 | */ |
||
223 | 1 | public function setGenerateReturnTypeHints($generate) { |
|
227 | |||
228 | /** |
||
229 | * Sets whether sorting is enabled |
||
230 | * |
||
231 | * @param $enabled bool `true` if it is enabled and `false` if not |
||
232 | * @return $this |
||
233 | */ |
||
234 | 1 | public function setSortingEnabled($enabled) { |
|
238 | |||
239 | /** |
||
240 | * Sets whether formatting is enabled |
||
241 | * |
||
242 | * @param $enabled bool `true` if it is enabled and `false` if not |
||
243 | * @return $this |
||
244 | */ |
||
245 | 1 | public function setFormattingEnabled($enabled) { |
|
249 | |||
250 | /** |
||
251 | * Returns the use statement sorting |
||
252 | * |
||
253 | * @param $sorting string|bool|Comparator|\Closure |
||
254 | * @return $this |
||
255 | */ |
||
256 | 1 | public function setUseStatementSorting($sorting) { |
|
260 | |||
261 | /** |
||
262 | * Returns the constant sorting |
||
263 | * |
||
264 | * @param $sorting string|bool|Comparator|\Closure |
||
265 | * @return $this |
||
266 | */ |
||
267 | 1 | public function setConstantSorting($sorting) { |
|
271 | |||
272 | /** |
||
273 | * Returns the property sorting |
||
274 | * |
||
275 | * @param $sorting string|bool|Comparator|\Closure |
||
276 | * @return $this |
||
277 | */ |
||
278 | 1 | public function setPropertySorting($sorting) { |
|
282 | |||
283 | /** |
||
284 | * Returns the method sorting |
||
285 | * |
||
286 | * @param $sorting string|bool|Comparator|\Closure |
||
287 | * @return $this |
||
288 | */ |
||
289 | 1 | public function setMethodSorting($sorting) { |
|
293 | } |
||
294 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.