MakeCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A replaceClass() 0 6 1
A getStub() 0 4 1
A getDefaultNamespace() 0 4 1
1
<?php
2
3
namespace BeyondCode\LaravelPackageTools\Commands;
4
5
class MakeCommand extends GeneratorCommand
6
{
7
    protected $type = 'Command';
8
9
    protected function replaceClass($stub, $name)
10
    {
11
        $stub = parent::replaceClass($stub, $name);
12
13
        return str_replace('dummy:command', $this->option('command', 'command:name'), $stub);
14
    }
15
16
    protected function getStub()
17
    {
18
        return __DIR__.'/stubs/console.stub';
19
    }
20
21
    protected function getDefaultNamespace($rootNamespace): string
22
    {
23
        return $rootNamespace.'\Console\Commands';
24
    }
25
}
26