1 | <?php |
||
8 | class MakeBackpackCrudModel extends GeneratorCommand |
||
9 | { |
||
10 | /** |
||
11 | * The console command name. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $name = 'make:crud-model'; |
||
16 | |||
17 | /** |
||
18 | * The name and signature of the console command. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $signature = 'make:crud-model {name}'; |
||
23 | |||
24 | /** |
||
25 | * The console command description. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $description = 'Generate a Backpack CRUD model'; |
||
30 | |||
31 | /** |
||
32 | * The type of class being generated. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $type = 'Model'; |
||
37 | |||
38 | /** |
||
39 | * Get the stub file for the generator. |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | protected function getStub() |
||
47 | |||
48 | /** |
||
49 | * Get the default namespace for the class. |
||
50 | * |
||
51 | * @param string $rootNamespace |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | protected function getDefaultNamespace($rootNamespace) |
||
59 | |||
60 | /** |
||
61 | * Replace the table name for the given stub. |
||
62 | * |
||
63 | * @param string $stub |
||
64 | * @param string $name |
||
65 | * |
||
66 | * @return string |
||
|
|||
67 | */ |
||
68 | protected function replaceTable(&$stub, $name) |
||
78 | |||
79 | /** |
||
80 | * Build the class with the given name. |
||
81 | * |
||
82 | * @param string $name |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | protected function buildClass($name) |
||
92 | |||
93 | /** |
||
94 | * Get the console command options. |
||
95 | * |
||
96 | * @return array |
||
97 | */ |
||
98 | protected function getOptions() |
||
104 | } |
||
105 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.