1 | <?php |
||
17 | class PublishSites extends Command |
||
18 | { |
||
19 | use ItFetchesSites, ItFetchesServers, DiesIfEnvVariableIsnotInstalled; |
||
20 | |||
21 | /** |
||
22 | * The name and signature of the console command. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $signature = 'publish:sites {--dump}'; |
||
27 | |||
28 | /** |
||
29 | * The console command description. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $description = 'Show sites on current server'; |
||
34 | |||
35 | /** |
||
36 | * Sites. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $sites; |
||
41 | |||
42 | /** |
||
43 | * Site names. |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | protected $site_names; |
||
48 | |||
49 | /** |
||
50 | * Server names. |
||
51 | * |
||
52 | * @var Client |
||
53 | */ |
||
54 | protected $http; |
||
55 | |||
56 | /** |
||
57 | * SaveEnvVariable constructor. |
||
58 | * |
||
59 | */ |
||
60 | public function __construct(Client $http) |
||
65 | |||
66 | /** |
||
67 | * Handle command. |
||
68 | */ |
||
69 | public function handle() |
||
104 | |||
105 | /** |
||
106 | * Server name. |
||
107 | * |
||
108 | * @param $server |
||
109 | * @return mixed |
||
110 | */ |
||
111 | protected function serverName($server) |
||
115 | |||
116 | /** |
||
117 | * Abort command execution. |
||
118 | */ |
||
119 | protected function abortCommandExecution() |
||
123 | } |
||
124 |
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.