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

AbstractCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
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