1 | <?php |
||
14 | class HoneybadgerInstallCommand extends Command |
||
15 | { |
||
16 | use RequiredInput; |
||
17 | |||
18 | /** |
||
19 | * The name and signature of the console command. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $signature = 'honeybadger:install {apiKey?}'; |
||
24 | |||
25 | /** |
||
26 | * The console command description. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $description = 'Install and configure Honeybadger'; |
||
31 | |||
32 | /** |
||
33 | * Configuration from gathered input. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $config = []; |
||
38 | |||
39 | /** |
||
40 | * @var \Honeybadger\HoneybadgerLaravel\Contracts\Installer; |
||
41 | */ |
||
42 | protected $installer; |
||
43 | |||
44 | /** |
||
45 | * @var \Honeybadger\HoneybadgerLaravel\CommandTasks |
||
46 | */ |
||
47 | protected $tasks; |
||
48 | |||
49 | /** |
||
50 | * Execute the console command. |
||
51 | * |
||
52 | * @return mixed |
||
53 | */ |
||
54 | public function handle(Installer $installer, CommandTasks $commandTasks) |
||
83 | |||
84 | /** |
||
85 | * Prompt for input and gather responses. |
||
86 | * |
||
87 | * @return array |
||
88 | */ |
||
89 | private function gatherConfig() : array |
||
95 | |||
96 | /** |
||
97 | * Prompt for the API key. |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | private function promptForApiKey() : string |
||
105 | |||
106 | /** |
||
107 | * Send test exception to Honeybadger. |
||
108 | * |
||
109 | * @return array |
||
110 | */ |
||
111 | private function sendTest() : array |
||
130 | |||
131 | /** |
||
132 | * Write configuration values to the env files. |
||
133 | * |
||
134 | * @return void |
||
135 | */ |
||
136 | private function writeEnv() : void |
||
158 | |||
159 | /** |
||
160 | * Publish the config file for Lumen or Laravel. |
||
161 | * |
||
162 | * @return bool |
||
163 | */ |
||
164 | public function publishConfig() : bool |
||
172 | |||
173 | /** |
||
174 | * Output the success message. |
||
175 | * |
||
176 | * @param string $noticeId |
||
177 | * @return void |
||
178 | */ |
||
179 | private function outputSuccessMessage(string $noticeId) : void |
||
183 | } |
||
184 |