1 | <?php |
||
7 | class MakeBackpackCrudController extends GeneratorCommand |
||
8 | { |
||
9 | /** |
||
10 | * The console command name. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $name = 'make:crud-controller'; |
||
15 | |||
16 | /** |
||
17 | * The name and signature of the console command. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $signature = 'make:crud-controller {name}'; |
||
22 | |||
23 | /** |
||
24 | * The console command description. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $description = 'Generate a Backpack CRUD controller'; |
||
29 | |||
30 | /** |
||
31 | * The type of class being generated. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $type = 'Controller'; |
||
36 | |||
37 | /** |
||
38 | * Get the destination class path. |
||
39 | * |
||
40 | * @param string $name |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | protected function getPath($name) |
||
50 | |||
51 | /** |
||
52 | * Get the stub file for the generator. |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | protected function getStub() |
||
60 | |||
61 | /** |
||
62 | * Get the default namespace for the class. |
||
63 | * |
||
64 | * @param string $rootNamespace |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | protected function getDefaultNamespace($rootNamespace) |
||
72 | |||
73 | /** |
||
74 | * Replace the table name for the given stub. |
||
75 | * |
||
76 | * @param string $stub |
||
77 | * @param string $name |
||
78 | * |
||
79 | * @return string |
||
|
|||
80 | */ |
||
81 | protected function replaceNameStrings(&$stub, $name) |
||
90 | |||
91 | /** |
||
92 | * Build the class with the given name. |
||
93 | * |
||
94 | * @param string $name |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | protected function buildClass($name) |
||
104 | |||
105 | /** |
||
106 | * Get the console command options. |
||
107 | * |
||
108 | * @return array |
||
109 | */ |
||
110 | protected function getOptions() |
||
116 | } |
||
117 |
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.