Remove::getDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace eXpansion\Bundle\Maps\ChatCommand;
4
5
use eXpansion\Bundle\Maps\Plugins\ManiaExchange;
6
use eXpansion\Bundle\Maps\Plugins\Maps;
7
use eXpansion\Framework\AdminGroups\Helpers\AdminGroups;
8
use eXpansion\Framework\AdminGroups\Model\AbstractAdminChatCommand;
9
use Symfony\Component\Console\Input\InputArgument;
10
use Symfony\Component\Console\Input\InputInterface;
11
12
/**
13
 *
14
 * @author  Reaby
15
 *
16
 */
17 View Code Duplication
class Remove extends AbstractAdminChatCommand
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...
18
{
19
20
    /** @var  Maps */
21
    protected $plugin;
22
23
    public function __construct(
24
        $command,
25
        $permission,
26
        $aliases = [],
27
        AdminGroups $adminGroupsHelper,
28
        Maps $plugin
29
    ) {
30
        parent::__construct($command, $permission, $aliases, $adminGroupsHelper);
31
        $this->plugin = $plugin;
32
    }
33
34
35
    public function getDescription()
36
    {
37
        return 'expansion_mx.command.remove.description';
38
    }
39
40
    protected function configure()
41
    {
42
        parent::configure();
43
44
        $this->inputDefinition->addArgument(
45
            new InputArgument('index', InputArgument::REQUIRED, 'expansion_mx.command.remove.index')
46
        );
47
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    public function execute($login, InputInterface $input)
54
    {
55
        $index = $input->getArgument('index');
56
        $this->plugin->removeMap($login, $index);
57
    }
58
59
}
60
61
62