1 | <?php |
||
9 | class ViewModelMakeCommand extends GeneratorCommand |
||
10 | { |
||
11 | /** |
||
12 | * The console command name. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $name = 'make:view-model'; |
||
17 | |||
18 | /** |
||
19 | * The console command description. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $description = 'Create a new view-model class'; |
||
24 | |||
25 | /** |
||
26 | * The type of class being generated. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $type = 'View model'; |
||
31 | |||
32 | /** |
||
33 | * Execute the console command. |
||
34 | * |
||
35 | * @return void |
||
36 | */ |
||
37 | public function handle() |
||
43 | |||
44 | /** |
||
45 | * Get the destination class path. |
||
46 | * |
||
47 | * @param string $name |
||
48 | * @return string |
||
49 | */ |
||
50 | protected function getPath($name) |
||
60 | |||
61 | /** |
||
62 | * Get the stub file for the generator. |
||
63 | * |
||
64 | * @return string |
||
65 | */ |
||
66 | protected function getStub() |
||
70 | |||
71 | /** |
||
72 | * Replace the namespace for the given stub. |
||
73 | * |
||
74 | * @param string $stub |
||
75 | * @param string $name |
||
76 | * @return $this |
||
77 | */ |
||
78 | protected function replaceNamespace(&$stub, $name) |
||
88 | |||
89 | /** |
||
90 | * Check wheter the name param has |
||
91 | * namespace or not. |
||
92 | * |
||
93 | * @param string $stub |
||
|
|||
94 | * @param string $name |
||
95 | * @return $this |
||
96 | */ |
||
97 | protected function hasNamespace($name) |
||
101 | |||
102 | /** |
||
103 | * Get the console command options. |
||
104 | * |
||
105 | * @return array |
||
106 | */ |
||
107 | protected function getOptions() |
||
113 | } |
||
114 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.