| Conditions | 3 |
| Paths | 5 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function handle() |
||
| 30 | { |
||
| 31 | $success_msg = 'The varnish cache has been flushed!'; |
||
| 32 | $error_msg = 'Failed to flush the varnish cache!'; |
||
| 33 | |||
| 34 | try { |
||
| 35 | if ((new Varnish())->flush()) { |
||
| 36 | $this->comment($success_msg); |
||
| 37 | |||
| 38 | return true; |
||
| 39 | } else { |
||
| 40 | $this->error($error_msg); |
||
| 41 | } |
||
| 42 | } catch (\Exception $exception) { |
||
| 43 | $this->error($error_msg); |
||
| 44 | $this->error($exception->getMessage()); |
||
| 45 | } |
||
| 46 | |||
| 47 | return false; |
||
| 48 | } |
||
| 49 | } |
||
| 50 |