1 | <?php |
||
7 | class GenerateDoc extends Command |
||
8 | { |
||
9 | /** |
||
10 | * The name and signature of the console command. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $signature = 'doc:generate'; |
||
15 | |||
16 | /** |
||
17 | * The console command description. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $description = 'Generate api documentation'; |
||
22 | |||
23 | /** |
||
24 | * Create a new command instance. |
||
25 | * |
||
26 | * @return void |
||
|
|||
27 | */ |
||
28 | public function __construct() |
||
32 | |||
33 | /** |
||
34 | * Execute the console command. |
||
35 | * |
||
36 | * @return mixed |
||
37 | */ |
||
38 | public function handle() |
||
69 | |||
70 | /** |
||
71 | * Get list of all registered routes. |
||
72 | * |
||
73 | * @return collection |
||
74 | */ |
||
75 | protected function getRoutes() |
||
89 | |||
90 | /** |
||
91 | * Generate headers for the given route. |
||
92 | * |
||
93 | * @param array &$route |
||
94 | * @param object $reflectionClass |
||
95 | * @param string $method |
||
96 | * @param array $skipLoginCheck |
||
97 | * @return void |
||
98 | */ |
||
99 | protected function getHeaders(&$route, $reflectionClass, $method, $skipLoginCheck) |
||
114 | |||
115 | /** |
||
116 | * Generate description and params for the given route |
||
117 | * based on the docblock. |
||
118 | * |
||
119 | * @param array &$route |
||
120 | * @param object $reflectionMethod] |
||
121 | * @return void |
||
122 | */ |
||
123 | protected function processDocBlock(&$route, $reflectionMethod) |
||
138 | |||
139 | /** |
||
140 | * Generate post body for the given route. |
||
141 | * |
||
142 | * @param array &$route |
||
143 | * @param object $reflectionMethod |
||
144 | * @param array $validationRules |
||
145 | * @return void |
||
146 | */ |
||
147 | protected function getPostData(&$route, $reflectionMethod, $validationRules) |
||
183 | |||
184 | /** |
||
185 | * Generate application errors. |
||
186 | * |
||
187 | * @return array |
||
188 | */ |
||
189 | protected function getErrors() |
||
209 | |||
210 | /** |
||
211 | * Get the fiven method body code. |
||
212 | * |
||
213 | * @param object $reflectionMethod |
||
214 | * @return string |
||
215 | */ |
||
216 | protected function getMethodBody($reflectionMethod) |
||
228 | } |
||
229 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.