1 | <?php |
||
13 | class DataTableMakeCommand extends GeneratorCommand |
||
14 | { |
||
15 | use ConfirmableTrait; |
||
16 | use ConsoleMakeModuleCommand; |
||
17 | |||
18 | /** |
||
19 | * The model name. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $modelName; |
||
24 | |||
25 | /** |
||
26 | * The transformer name. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $transformerName; |
||
31 | |||
32 | /** |
||
33 | * The console command name. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $name = 'make:datatable'; |
||
38 | |||
39 | /** |
||
40 | * The console command description. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $description = 'Create a new datatable class'; |
||
45 | |||
46 | /** |
||
47 | * The type of class being generated. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $type = 'Datatable'; |
||
52 | |||
53 | /** |
||
54 | * Build the class with the given name. |
||
55 | * |
||
56 | * @param string $name |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | protected function buildClass($name): string |
||
70 | |||
71 | /** |
||
72 | * Replace the model and transformer for the given stub. |
||
73 | * |
||
74 | * @param string $stub |
||
75 | * @param string $model |
||
76 | * @param string $transformer |
||
|
|||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | protected function replaceClasses($stub, $model, $transformer = null): string |
||
124 | |||
125 | /** |
||
126 | * Get the stub file for the generator. |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | protected function getStub(): string |
||
134 | |||
135 | /** |
||
136 | * Get the default namespace for the class. |
||
137 | * |
||
138 | * @param string $rootNamespace |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | protected function getDefaultNamespace($rootNamespace): string |
||
146 | |||
147 | /** |
||
148 | * Get the console command arguments. |
||
149 | * |
||
150 | * @return array |
||
151 | */ |
||
152 | protected function getArguments(): array |
||
158 | |||
159 | /** |
||
160 | * Get the console command arguments. |
||
161 | * |
||
162 | * @return array |
||
163 | */ |
||
164 | protected function getOptions(): array |
||
172 | } |
||
173 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.