MakeTacticianHandlerCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getStub() 0 4 1
A getDefaultNamespace() 0 4 1
A getPath() 0 4 1
1
<?php
2
3
namespace Victormln\LaravelTactician\Commands;
4
5
use Illuminate\Console\GeneratorCommand;
6
7
/**
8
 * Create a new Tactician Command Handler
9
 * @package Victormln\LaravelTactician\Commands
10
 */
11
class MakeTacticianHandlerCommand extends GeneratorCommand
12
{
13
    /**
14
     * The console command name.
15
     *
16
     * @var string
17
     */
18
    protected $name = 'make:tactician:handler';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'Create a new Tactician Command Handler';
26
27
    /**
28
     * Get the stub file for the generator.
29
     *
30
     * @return string
31
     */
32 5
    protected function getStub()
33
    {
34 5
        return __DIR__.'/../../stubs/handler.stub';
35
    }
36
37
    /**
38
     * Get the default namespace for the class.
39
     *
40
     * @param  string $rootNamespace
41
     * @return string
42
     */
43 5
    protected function getDefaultNamespace($rootNamespace)
44
    {
45 5
        return "$rootNamespace\\CommandBus\\Handlers";
46
    }
47
48
    /**
49
     * Get the destination class path.
50
     *
51
     * @param  string $name
52
     * @return string
53
     */
54 5
    protected function getPath($name)
55
    {
56 5
        return parent::getPath($name.'Handler');
57
    }
58
}
59