| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 5 | public function handle() |
|
| 20 | { |
||
| 21 | 5 | $config = App::make(Repository::class); |
|
| 22 | |||
| 23 | 5 | $indexPath = $config->get('search.index.path'); |
|
| 24 | |||
| 25 | 5 | $this->info('Destroying the search index.'); |
|
| 26 | |||
| 27 | 5 | if (File::isDirectory($indexPath)) { |
|
| 28 | 5 | File::deleteDirectory($indexPath); |
|
| 29 | 5 | $this->info('Search index is destroyed.'); |
|
| 30 | 5 | } else { |
|
| 31 | 1 | $this->comment('There was nothing to destroy? Try a rebuild.'); |
|
| 32 | } |
||
| 33 | 5 | } |
|
| 34 | } |
||
| 35 |