Passed
Branch master (8cb5b2)
by Christopher
04:33 queued 12s
created

Migrate::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2.0116

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 1
dl 0
loc 10
ccs 6
cts 7
cp 0.8571
crap 2.0116
rs 10
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
2
namespace Triadev\Leopard\Console\Commands\Mapping;
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
use Illuminate\Console\ConfirmableTrait;
5
use Triadev\Leopard\Business\Mapping\Mapper;
6
7
class Migrate extends BaseCommand
0 ignored issues
show
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
8
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class Migrate
Loading history...
9
    use ConfirmableTrait;
10
    
11
    /**
12
     * The console command name.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'triadev:mapping:migrate {--index=} {--type=}';
0 ignored issues
show
Coding Style introduced by
Protected member variable "signature" must contain a leading underscore
Loading history...
17
    
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Start the mapping migrations.';
0 ignored issues
show
Coding Style introduced by
Protected member variable "description" must contain a leading underscore
Loading history...
24
    
25
    /**
26
     * Execute the console command.
27
     *
28
     * @param Mapper $mapper
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
29
     * @throws \Throwable
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
introduced by
Comment missing for @throws tag in function comment
Loading history...
30
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
31 1
    public function handle(Mapper $mapper)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
32
    {
33 1
        if (!$this->confirmToProceed()) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
34
            return;
35
        }
36
        
37 1
        $mapper->run(
38 1
            $this->getMappingPath(),
39 1
            $this->option('index'),
40 1
            $this->option('type')
41
        );
42 1
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end handle()
Loading history...
43
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
44