Migrate   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 34
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 2
1
<?php
2
namespace Triadev\Leopard\Console\Commands\Mapping;
3
4
use Illuminate\Console\ConfirmableTrait;
5
use Triadev\Leopard\Business\Mapping\Mapper;
6
7
class Migrate extends BaseCommand
8
{
9
    use ConfirmableTrait;
10
    
11
    /**
12
     * The console command name.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'triadev:mapping:migrate {--index=} {--type=}';
17
    
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Start the mapping migrations.';
24
    
25
    /**
26
     * Execute the console command.
27
     *
28
     * @param Mapper $mapper
29
     * @throws \Throwable
30
     */
31 2
    public function handle(Mapper $mapper)
32
    {
33 2
        if (!$this->confirmToProceed()) {
34
            return;
35
        }
36
        
37 2
        $mapper->run(
38 2
            $this->getMappingPath(),
39 2
            $this->option('index'),
40 2
            $this->option('type')
41
        );
42 2
    }
43
}
44