1 | <?php |
||
11 | class ControllerMakeCommand extends GeneratorCommand |
||
12 | { |
||
13 | use ModuleCommandTrait; |
||
14 | |||
15 | /** |
||
16 | * The name of argument being used. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $argumentName = 'controller'; |
||
21 | |||
22 | /** |
||
23 | * The console command name. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $name = 'module:make-controller'; |
||
28 | |||
29 | /** |
||
30 | * The console command description. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $description = 'Generate new restful controller for the specified module.'; |
||
35 | |||
36 | /** |
||
37 | * Get controller name. |
||
38 | * |
||
39 | * @return string |
||
40 | */ |
||
41 | 86 | public function getDestinationFilePath() |
|
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | 86 | protected function getTemplateContents() |
|
70 | |||
71 | /** |
||
72 | * Get the console command arguments. |
||
73 | * |
||
74 | * @return array |
||
75 | */ |
||
76 | 94 | protected function getArguments() |
|
83 | |||
84 | /** |
||
85 | * @return array |
||
86 | */ |
||
87 | 94 | protected function getOptions() |
|
93 | |||
94 | /** |
||
95 | * @return array|string |
||
96 | */ |
||
97 | 86 | protected function getControllerName() |
|
107 | |||
108 | /** |
||
109 | * @param string|array $controllerName |
||
110 | * |
||
111 | * @return array|string |
||
112 | */ |
||
113 | 86 | protected function sanitizeControllerName($controllerName) |
|
122 | |||
123 | /** |
||
124 | * @return array|string |
||
125 | */ |
||
126 | 86 | private function getControllerNameWithoutNamespace() |
|
130 | |||
131 | 86 | public function getDefaultNamespace() : string |
|
135 | |||
136 | /** |
||
137 | * Get the stub file name based on the plain option |
||
138 | * @return string |
||
139 | */ |
||
140 | 86 | private function getStubName() |
|
148 | } |
||
149 |