1 | <?php |
||
15 | class PublishCertificates extends Command |
||
16 | { |
||
17 | use ChecksEnv, DiesIfEnvVariableIsnotInstalled; |
||
18 | |||
19 | /** |
||
20 | * The name and signature of the console command. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $signature = 'publish:certificates {--server=} {--site=} {--dump}'; |
||
25 | |||
26 | /** |
||
27 | * The console command description. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $description = 'List SSL certificates'; |
||
32 | |||
33 | /** |
||
34 | * API endpoint URL |
||
35 | * |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $url; |
||
39 | |||
40 | /** |
||
41 | * Server forge id. |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $server; |
||
46 | |||
47 | /** |
||
48 | * Laravel forge site id. |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $site; |
||
53 | |||
54 | /** |
||
55 | * Guzzle http client. |
||
56 | * |
||
57 | * @var Client |
||
58 | */ |
||
59 | protected $http; |
||
60 | |||
61 | /** |
||
62 | * Create a new command instance. |
||
63 | * |
||
64 | */ |
||
65 | public function __construct(Client $http) |
||
70 | |||
71 | /** |
||
72 | * Execute the console command. |
||
73 | * |
||
74 | */ |
||
75 | public function handle() |
||
118 | |||
119 | /** |
||
120 | * Obtain API URL endpoint. |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | protected function obtainAPIURLEndpoint() |
||
130 | |||
131 | /** |
||
132 | * Abort command execution? |
||
133 | */ |
||
134 | protected function abortCommandExecution() |
||
140 | } |
||
141 |
An exit expression should only be used in rare cases. For example, if you write a short command line script.
In most cases however, using an
exit
expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.