1 | <?php |
||
8 | class ActionMakeCommand extends GeneratorCommand |
||
9 | { |
||
10 | /** |
||
11 | * The console command name. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $signature = 'adr:action {name}'; |
||
16 | |||
17 | /** |
||
18 | * The console command description. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $description = 'Create a new action'; |
||
23 | |||
24 | /** |
||
25 | * The type of class being generated. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $type = 'Action'; |
||
30 | |||
31 | /** |
||
32 | * Get the stub file for the generator. |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | protected function getStub() |
||
40 | |||
41 | /** |
||
42 | * Get the default namespace for the class. |
||
43 | * |
||
44 | * @param string $rootNamespace |
||
|
|||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | protected function getMethodName() |
||
52 | |||
53 | /** |
||
54 | * Get the default namespace for the class. |
||
55 | * |
||
56 | * @param string $rootNamespace |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | protected function getDefaultNamespace($rootNamespace) |
||
64 | |||
65 | /** |
||
66 | * Get the desired class name from the input. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | protected function getNameInput() |
||
81 | |||
82 | /** |
||
83 | * Build the class with the given name. |
||
84 | * |
||
85 | * @param string $name |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | protected function buildClass($name) |
||
95 | |||
96 | /** |
||
97 | * Replace the method name in the given stub. |
||
98 | * |
||
99 | * @param string $stub |
||
100 | * @param string $name |
||
101 | * |
||
102 | * @return $this |
||
103 | */ |
||
104 | protected function replaceMethod(&$stub) |
||
114 | } |
||
115 |
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.