1 | <?php |
||
9 | class ServiceMakeCommand extends GeneratorCommand |
||
10 | { |
||
11 | /** |
||
12 | * The name and signature of the console command. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $signature = 'adr:service {name}'; |
||
17 | |||
18 | /** |
||
19 | * The console command description. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $description = 'Create new service definition and handler classes'; |
||
24 | |||
25 | /** |
||
26 | * The type of class being generated. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $type = 'Service'; |
||
31 | |||
32 | /** |
||
33 | * Execute the console command. |
||
34 | */ |
||
35 | public function handle() |
||
41 | |||
42 | /** |
||
43 | * Get the stub file for the generator. |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | protected function getStub() |
||
51 | |||
52 | /** |
||
53 | * Get the default namespace for the class. |
||
54 | * |
||
55 | * @param string $rootNamespace |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | protected function getDefaultNamespace($rootNamespace) |
||
69 | |||
70 | /** |
||
71 | * Get the method name for the class. |
||
72 | * |
||
73 | * @param string $rootNamespace |
||
|
|||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | protected function getMethodName() |
||
81 | |||
82 | /** |
||
83 | * Get the desired class name from the input. |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | protected function getNameInput() |
||
98 | |||
99 | /** |
||
100 | * Build the class with the given name. |
||
101 | * |
||
102 | * @param string $name |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | protected function buildClass($name) |
||
112 | |||
113 | /** |
||
114 | * Replace the method name in the given stub. |
||
115 | * |
||
116 | * @param string $stub |
||
117 | * @param string $name |
||
118 | * |
||
119 | * @return $this |
||
120 | */ |
||
121 | protected function replaceMethod(&$stub) |
||
131 | } |
||
132 |
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.