Optimise   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 25
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
3
namespace BestServedCold\LaravelZendSearch\Laravel\Console;
4
5
use BestServedCold\LaravelZendSearch\Laravel\Index;
6
use Illuminate\Console\Command;
7
use Illuminate\Support\Facades\App;
8
9
/**
10
 * Class OptimiseCommand
11
 * @package BestServedCold\LaravelZendSearch\Laravel\Console
12
 */
13
class Optimise extends Command
14
{
15
    /**
16
     * @var string $name
17
     */
18
    protected $name = 'search:optimise';
19
20
    /**
21
     * @var string $description
22
     */
23
    protected $description = 'Optimise the search index storage.';
24
25
    /**
26
     * Handle
27
     *
28
     * @return void
29
     */
30 4
    public function handle()
31
    {
32 4
        $this->info('Optimising search index.');
33 4
        $index = App::make(Index::class);
34 4
        $index->open()->get()->optimize();
35 4
        $this->info('Optimising finished.');
36 4
    }
37
}
38