1 | <?php |
||
12 | class HoneybadgerInstallCommand extends Command |
||
13 | { |
||
14 | use RequiredInput; |
||
15 | |||
16 | /** |
||
17 | * The name and signature of the console command. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $signature = 'honeybadger:install {apiKey?}'; |
||
22 | |||
23 | /** |
||
24 | * The console command description. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $description = 'Install and configure Honeybadger'; |
||
29 | |||
30 | /** |
||
31 | * Configuration from gathered input. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $config = []; |
||
36 | |||
37 | /** |
||
38 | * @var \Honeybadger\HoneybadgerLaravel\Contracts\Installer; |
||
39 | */ |
||
40 | protected $installer; |
||
41 | |||
42 | /** |
||
43 | * @var \Honeybadger\HoneybadgerLaravel\CommandTasks |
||
44 | */ |
||
45 | protected $tasks; |
||
46 | |||
47 | /** |
||
48 | * Execute the console command. |
||
49 | * |
||
50 | * @return mixed |
||
51 | */ |
||
52 | public function handle(Installer $installer, CommandTasks $commandTasks) |
||
77 | |||
78 | /** |
||
79 | * Prompt for input and gather responses. |
||
80 | * |
||
81 | * @return array |
||
82 | */ |
||
83 | private function gatherConfig() : array |
||
90 | |||
91 | /** |
||
92 | * Prompt for the API key. |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | private function promptForApiKey() : string |
||
100 | |||
101 | /** |
||
102 | * Send test exception to Honeybadger. |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | private function sendTest() : array |
||
119 | |||
120 | /** |
||
121 | * Write configuration values to the env files. |
||
122 | * |
||
123 | * @return void |
||
124 | */ |
||
125 | private function writeEnv() : void |
||
143 | |||
144 | /** |
||
145 | * Publish the config file for Lumen or Laravel. |
||
146 | * |
||
147 | * @return bool |
||
148 | */ |
||
149 | public function publishConfig() : bool |
||
157 | |||
158 | /** |
||
159 | * Output the success message. |
||
160 | * |
||
161 | * @param string $noticeId |
||
162 | * @return void |
||
163 | */ |
||
164 | private function outputSuccessMessage(string $noticeId) : void |
||
172 | } |
||
173 |