Completed
Push — master ( 9901a6...4d46a6 )
by Fumio
03:38
created

MigrationMakeCommand::getDefaultNamespace()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 2
eloc 2
c 2
b 0
f 1
nc 2
nop 0
dl 4
loc 4
ccs 2
cts 2
cp 1
crap 2
rs 10
1
<?php
2
3
namespace LaravelPlus\Extension\Database\Console;
4
5
use Jumilla\Versionia\Laravel\Console\MigrationMakeCommand as BaseCommand;
6
use LaravelPlus\Extension\Addons\Addon;
7
use LaravelPlus\Extension\Generators\GeneratorCommandTrait;
8
9 View Code Duplication
class MigrationMakeCommand extends BaseCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    use GeneratorCommandTrait;
12
13
    /**
14
     * The console command singature.
15
     *
16
     * @var string
17
     */
18
    protected $signature = 'make:migration
19
        {name : The name of the class}
20
        {--a|addon= : The name of the addon}
21
        {--create= : The table to be created}
22
        {--update= : The table to be updated}
23
    ';
24
25
    /**
26
     * The console command description.
27
     *
28
     * @var string
29
     */
30
    protected $description = '[+] Create a new migration class';
31
32
    /**
33
     * The constructor.
34
     */
35 5
    public function __construct()
36
    {
37 5
        parent::__construct();
38
39 5
        $this->setStubDirectory(__DIR__.'/../stubs');
40 5
    }
41
42
    /**
43
     * Get the default namespace for the class.
44
     *
45
     * @return string
46
     */
47 2
    protected function getDefaultNamespace()
48
    {
49 2
        return $this->getRootNamespace().'\\'.($this->onAddon() ? 'Migrations' : 'Database\\Migrations');
50
    }
51
}
52