1 | <?php |
||
8 | class MakeCommand extends GeneratorCommand |
||
9 | { |
||
10 | /** |
||
11 | * The console command name. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $signature = 'admin:make {name} {--model=} {--O|output}'; |
||
16 | |||
17 | /** |
||
18 | * The console command description. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $description = 'Make empty admin controller'; |
||
23 | |||
24 | /** |
||
25 | * @var ResourceGenerator |
||
26 | */ |
||
27 | protected $generator; |
||
28 | |||
29 | /** |
||
30 | * Execute the console command. |
||
31 | * |
||
32 | * @return void |
||
33 | */ |
||
34 | public function handle() |
||
52 | |||
53 | /** |
||
54 | * @param string $modelName |
||
55 | */ |
||
56 | protected function output($modelName) |
||
64 | |||
65 | /** |
||
66 | * Determine if the model is exists. |
||
67 | * |
||
68 | * @return bool |
||
69 | */ |
||
70 | protected function modelExists() |
||
80 | |||
81 | /** |
||
82 | * Replace the class name for the given stub. |
||
83 | * |
||
84 | * @param string $stub |
||
85 | * @param string $name |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | protected function replaceClass($stub, $name) |
||
111 | |||
112 | /** |
||
113 | * @param string $code |
||
114 | * @return string |
||
115 | */ |
||
116 | protected function indentCodes($code) |
||
122 | |||
123 | /** |
||
124 | * Get the stub file for the generator. |
||
125 | * |
||
126 | * @return string |
||
127 | */ |
||
128 | protected function getStub() |
||
136 | |||
137 | /** |
||
138 | * Get the default namespace for the class. |
||
139 | * |
||
140 | * @param string $rootNamespace |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | protected function getDefaultNamespace($rootNamespace) |
||
152 | |||
153 | /** |
||
154 | * Get the desired class name from the input. |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | protected function getNameInput() |
||
166 | } |
||
167 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.