Conditions | 2 |
Paths | 3 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | public function handle() |
||
40 | { |
||
41 | try { |
||
42 | DB::statement('show tables'); |
||
43 | $this->info('Database connection available!'); |
||
44 | } catch( \Illuminate\Database\QueryException $e) { |
||
45 | $this->error('Database connection not available!'); |
||
46 | exit(1); // return a non-0-code to be used in shell scripts as a falsy exit state |
||
|
|||
47 | } |
||
50 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.