Passed
Push — develop ( 02000e...ef43ee )
by Kevin
02:16
created

AbstractCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setName() 0 7 2
1
<?php
2
3
namespace Magium\Configuration\Console\Command;
4
5
use Symfony\Component\Console\Command\Command;
6
7
abstract class AbstractCommand extends Command
8
{
9
    const MAGIUM_PREFIX = 'magium:configuration:';
10
11
    private $useShort;
12
13 26
    public function __construct($name = null, $useShort = false)
14
    {
15 26
        $this->useShort = $useShort;
16 26
        parent::__construct($name);
17 26
    }
18
19 26
    public function setName($name)
20
    {
21 26
        if ($this->useShort) {
22 2
            $name = substr($name, strlen(self::MAGIUM_PREFIX));
23
        }
24 26
        return parent::setName($name);
25
    }
26
27
}
28