1 | <?php |
||
9 | class MakeCommand extends CommandGenerator |
||
10 | { |
||
11 | /** |
||
12 | * Module folders to be created. |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $listFolders = []; |
||
17 | |||
18 | /** |
||
19 | * Module files to be created. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $listFiles = []; |
||
24 | |||
25 | /** |
||
26 | * Module signature option. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $signOption = []; |
||
31 | |||
32 | /** |
||
33 | * Module stubs used to populate defined files. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $listStubs = []; |
||
38 | |||
39 | /** |
||
40 | * The modules instance. |
||
41 | * |
||
42 | * @var Modules |
||
43 | */ |
||
44 | protected $module; |
||
45 | |||
46 | /** |
||
47 | * The modules path. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $modulePath; |
||
52 | |||
53 | /** |
||
54 | * The modules info. |
||
55 | * |
||
56 | * @var Illuminate\Support\Collection; |
||
57 | */ |
||
58 | protected $moduleInfo; |
||
59 | |||
60 | /** |
||
61 | * The filesystem instance. |
||
62 | * |
||
63 | * @var Filesystem |
||
64 | */ |
||
65 | protected $files; |
||
66 | |||
67 | /** |
||
68 | * Array to store the configuration details. |
||
69 | * |
||
70 | * @var array |
||
71 | */ |
||
72 | protected $container; |
||
73 | |||
74 | /** |
||
75 | * String to store the command type. |
||
76 | * |
||
77 | * @var string |
||
78 | */ |
||
79 | protected $type; |
||
80 | |||
81 | /** |
||
82 | * Create a new command instance. |
||
83 | * |
||
84 | * @param Filesystem $files |
||
85 | * @param Modules $module |
||
86 | */ |
||
87 | public function __construct(Filesystem $files, Modules $module) |
||
94 | |||
95 | /** |
||
96 | * Execute the console command. |
||
97 | * |
||
98 | * @return mixed |
||
99 | */ |
||
100 | public function fire() |
||
117 | |||
118 | /** |
||
119 | * generate the console command. |
||
120 | * |
||
121 | * @return mixed |
||
122 | */ |
||
123 | protected function generate() |
||
163 | |||
164 | /** |
||
165 | * Resolve Container after getting file path. |
||
166 | * |
||
167 | * @param string $FilePath |
||
|
|||
168 | * |
||
169 | * @return array |
||
170 | */ |
||
171 | protected function resolveByPath($filePath) |
||
175 | |||
176 | /** |
||
177 | * Resolve Container after getting input option. |
||
178 | * |
||
179 | * @param string $option |
||
180 | * |
||
181 | * @return array |
||
182 | */ |
||
183 | protected function resolveByOption($option) |
||
187 | |||
188 | /** |
||
189 | * Parse slug name of the module. |
||
190 | * |
||
191 | * @param string $slug |
||
192 | * |
||
193 | * @return string |
||
194 | */ |
||
195 | protected function parseSlug($slug) |
||
199 | |||
200 | /** |
||
201 | * Parse class name of the module. |
||
202 | * |
||
203 | * @param string $slug |
||
204 | * |
||
205 | * @return string |
||
206 | */ |
||
207 | protected function parseName($name) |
||
225 | |||
226 | /** |
||
227 | * Make FilePath. |
||
228 | * |
||
229 | * @param string $folder |
||
230 | * @param string $name |
||
231 | * |
||
232 | * @return string |
||
233 | */ |
||
234 | protected function makeFilePath($folder, $name) |
||
247 | |||
248 | /** |
||
249 | * Make FileName. |
||
250 | * |
||
251 | * @param string $filePath |
||
252 | * |
||
253 | * @return string |
||
254 | */ |
||
255 | protected function makeFileName($filePath) |
||
259 | |||
260 | /** |
||
261 | * Build the directory for the class if necessary. |
||
262 | * |
||
263 | * @param string $path |
||
264 | * |
||
265 | * @return string |
||
266 | */ |
||
267 | protected function makeDirectory($path) |
||
273 | |||
274 | /** |
||
275 | * Get Namespace of the current file. |
||
276 | * |
||
277 | * @param string $file |
||
278 | * |
||
279 | * @return string |
||
280 | */ |
||
281 | protected function getNamespace($file) |
||
291 | |||
292 | /** |
||
293 | * Get the configured module base namespace. |
||
294 | * |
||
295 | * @return string |
||
296 | */ |
||
297 | protected function getBaseNamespace() |
||
301 | |||
302 | /** |
||
303 | * Get stub content by key. |
||
304 | * |
||
305 | * @param int $key |
||
306 | * |
||
307 | * @return string |
||
308 | */ |
||
309 | protected function getStubContent($stubName) |
||
318 | |||
319 | /** |
||
320 | * Replace placeholder text with correct values. |
||
321 | * |
||
322 | * @return string |
||
323 | */ |
||
324 | protected function formatContent($content) |
||
328 | } |
||
329 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.