1 | <?php |
||
13 | class DataTableMakeCommand extends GeneratorCommand |
||
14 | { |
||
15 | use ConsoleMakeModuleCommand; |
||
16 | |||
17 | /** |
||
18 | * The model name. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $modelName; |
||
23 | |||
24 | /** |
||
25 | * The transformer name. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $transformerName; |
||
30 | |||
31 | /** |
||
32 | * The console command name. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $name = 'make:datatable'; |
||
37 | |||
38 | /** |
||
39 | * The console command description. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $description = 'Create a new datatable class'; |
||
44 | |||
45 | /** |
||
46 | * The type of class being generated. |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $type = 'Datatable'; |
||
51 | |||
52 | /** |
||
53 | * Build the class with the given name. |
||
54 | * |
||
55 | * @param string $name |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | protected function buildClass($name) |
||
69 | |||
70 | /** |
||
71 | * Replace the model and transformer for the given stub. |
||
72 | * |
||
73 | * @param string $stub |
||
74 | * @param string $model |
||
75 | * @param string $transformer |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | protected function replaceClasses($stub, $model, $transformer = null) |
||
123 | |||
124 | /** |
||
125 | * Get the stub file for the generator. |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | protected function getStub() |
||
133 | |||
134 | /** |
||
135 | * Get the default namespace for the class. |
||
136 | * |
||
137 | * @param string $rootNamespace |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | protected function getDefaultNamespace($rootNamespace) |
||
145 | |||
146 | /** |
||
147 | * Get the console command arguments. |
||
148 | * |
||
149 | * @return array |
||
150 | */ |
||
151 | protected function getArguments() |
||
157 | |||
158 | /** |
||
159 | * Get the console command arguments. |
||
160 | * |
||
161 | * @return array |
||
162 | */ |
||
163 | protected function getOptions() |
||
171 | } |
||
172 |
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.