1 | <?php |
||
15 | class PublishIgnored extends Command |
||
16 | { |
||
17 | use ChecksSSHConnection; |
||
18 | |||
19 | /** |
||
20 | * The name and signature of the console command. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $signature = 'publish:ignored'; |
||
25 | |||
26 | /** |
||
27 | * The console command description. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $description = 'Publish ignored files into production'; |
||
32 | |||
33 | /** |
||
34 | * Server name |
||
35 | * |
||
36 | * @var String |
||
37 | */ |
||
38 | protected $server; |
||
39 | |||
40 | /** |
||
41 | * Guzzle http client. |
||
42 | * |
||
43 | * @var Client |
||
44 | */ |
||
45 | protected $http; |
||
46 | |||
47 | /** |
||
48 | * Create a new command instance. |
||
49 | * |
||
50 | */ |
||
51 | public function __construct(Client $http) |
||
56 | |||
57 | /** |
||
58 | * Execute the console command. |
||
59 | * |
||
60 | */ |
||
61 | public function handle() |
||
78 | |||
79 | /** |
||
80 | * Obtain ignored files |
||
81 | */ |
||
82 | protected function ignoredFiles() |
||
96 | |||
97 | /** |
||
98 | * Git ignored files path. |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | protected function path() |
||
106 | |||
107 | /** |
||
108 | * Abort command execution? |
||
109 | */ |
||
110 | protected function abortCommandExecution() |
||
119 | } |
||
120 |
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.