1 | <?php |
||
13 | class CommandController |
||
14 | { |
||
15 | /** |
||
16 | * The console kernel. |
||
17 | * |
||
18 | * @var \Illuminate\Contracts\Console\Kernel |
||
19 | */ |
||
20 | protected $kernel; |
||
21 | |||
22 | /** |
||
23 | * The validation factory implementation. |
||
24 | * |
||
25 | * @var \Illuminate\Contracts\Validation\Factory |
||
26 | */ |
||
27 | protected $validationFactory; |
||
28 | |||
29 | /** |
||
30 | * Create a new controller instance. |
||
31 | * |
||
32 | * @param \Illuminate\Contracts\Console\Kernel $kernel |
||
33 | * @param \Illuminate\Contracts\Validation\Factory $validationFactory |
||
34 | * |
||
35 | * @return void |
||
|
|||
36 | */ |
||
37 | 5 | public function __construct(Kernel $kernel, ValidationFactory $validationFactory) |
|
42 | |||
43 | /** |
||
44 | * Get artisan commands. |
||
45 | * |
||
46 | * @return \Illuminate\Http\Response |
||
47 | */ |
||
48 | 1 | public function __invoke() |
|
58 | |||
59 | /** |
||
60 | * Execute artisan command. |
||
61 | * |
||
62 | * @param \Illuminate\Http\Request $request |
||
63 | * |
||
64 | * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException |
||
65 | * |
||
66 | * @return \Illuminate\Http\Response |
||
67 | */ |
||
68 | 4 | public function execute(Request $request) |
|
96 | |||
97 | /** |
||
98 | * Flatten command parameters. |
||
99 | * |
||
100 | * @param array $parameters |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | 1 | protected function flatten(array $parameters) |
|
133 | |||
134 | /** |
||
135 | * Resolve command from kernel. |
||
136 | * |
||
137 | * @param string $name Command name |
||
138 | * |
||
139 | * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException |
||
140 | * |
||
141 | * @return \Symfony\Component\Console\Command\Command |
||
142 | */ |
||
143 | 4 | protected function resolve($name): Command |
|
155 | |||
156 | /** |
||
157 | * Build command validation rules. |
||
158 | * |
||
159 | * @param \Symfony\Component\Console\Command\Command $command |
||
160 | * |
||
161 | * @return array |
||
162 | */ |
||
163 | 3 | protected function rules(Command $command): array |
|
185 | } |
||
186 |
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.