1 | <?php |
||
8 | class ResponderMakeCommand extends GeneratorCommand |
||
9 | { |
||
10 | /** |
||
11 | * The name and signature of the console command. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $signature = 'adr:responder {name}'; |
||
16 | |||
17 | /** |
||
18 | * The console command description. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $description = 'Create new responder'; |
||
23 | |||
24 | /** |
||
25 | * The type of class being generated. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $type = 'Responder'; |
||
30 | |||
31 | /** |
||
32 | * Execute the console command. |
||
33 | */ |
||
34 | public function handle() |
||
40 | |||
41 | /** |
||
42 | * Get the stub file for the generator. |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | protected function getStub() |
||
50 | |||
51 | /** |
||
52 | * Get the default namespace for the class. |
||
53 | * |
||
54 | * @param string $rootNamespace |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | protected function getDefaultNamespace($rootNamespace) |
||
64 | |||
65 | /** |
||
66 | * Get the method name for the class. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | protected function getMethodName() |
||
74 | |||
75 | /** |
||
76 | * Get the desired class name from the input. |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | protected function getNameInput() |
||
91 | |||
92 | /** |
||
93 | * Build the class with the given name. |
||
94 | * |
||
95 | * @param string $name |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | protected function buildClass($name) |
||
105 | |||
106 | /** |
||
107 | * Replace the method name in the given stub. |
||
108 | * |
||
109 | * @param string $stub |
||
110 | * @param string $name |
||
|
|||
111 | * |
||
112 | * @return $this |
||
113 | */ |
||
114 | protected function replaceMethod(&$stub) |
||
124 | } |
||
125 |
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.