1 | <?php |
||
10 | class CachedServiceMakeCommand extends GeneratorCommand |
||
11 | { |
||
12 | /** @var string */ |
||
13 | protected $signature = 'adr:cache {name} {--parent} {--generate-parent}'; |
||
14 | |||
15 | /** @var string */ |
||
16 | protected $description = 'Create new cached service class.'; |
||
17 | |||
18 | /** @var string */ |
||
19 | protected $type = 'Cached Service'; |
||
20 | |||
21 | /** @var string */ |
||
22 | protected $defaultNamespace; |
||
23 | |||
24 | /** |
||
25 | * Execute the console command. |
||
26 | */ |
||
27 | public function handle() |
||
40 | |||
41 | /** |
||
42 | * Get the stub file for the generator. |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | protected function getStub() |
||
58 | |||
59 | /** |
||
60 | * Get the default namespace for the class. |
||
61 | * |
||
62 | * @param string $rootNamespace |
||
63 | * |
||
64 | * @return string |
||
65 | */ |
||
66 | protected function getDefaultNamespace($rootNamespace) |
||
78 | |||
79 | /** |
||
80 | * Get the desired class name from the input. |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | protected function getNameInput() |
||
88 | |||
89 | /** |
||
90 | * Get the parent name for the child class. |
||
91 | * |
||
92 | * @param string $rootNamespace |
||
|
|||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | protected function getParentName() |
||
100 | |||
101 | /** |
||
102 | * Get the parent fqcn for the child class. |
||
103 | * |
||
104 | * @param string $rootNamespace |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | protected function getParentFqcn() |
||
112 | |||
113 | /** |
||
114 | * Build the class with the given name. |
||
115 | * |
||
116 | * @param string $name |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | protected function buildClass($name) |
||
128 | |||
129 | /** |
||
130 | * Replace the parent class in the given stub. |
||
131 | * |
||
132 | * @param string $stub |
||
133 | * @param string $name |
||
134 | * |
||
135 | * @return $this |
||
136 | */ |
||
137 | protected function replaceParentClass(&$stub) |
||
143 | |||
144 | /** |
||
145 | * Replace the parent fqcn in the given stub. |
||
146 | * |
||
147 | * @param string $stub |
||
148 | * @param string $name |
||
149 | * |
||
150 | * @return $this |
||
151 | */ |
||
152 | protected function replaceParentFqcn(&$stub) |
||
158 | } |
||
159 |
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.