Completed
Branch master (220ce5)
by De Cramer
16:11
created

Jukebox   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 2
cbo 5
dl 0
loc 48
ccs 0
cts 24
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A getHelp() 0 4 1
A __construct() 0 9 1
A execute() 0 5 1
1
<?php
2
3
4
namespace eXpansion\Bundle\Maps\ChatCommand;
5
6
use eXpansion\Bundle\Maps\Plugins\Gui\MapsWindowFactory;
7
use eXpansion\Bundle\Maps\Plugins\Jukebox as JukeboxPlugin;
8
use eXpansion\Bundle\Maps\Plugins\Maps;
9
use eXpansion\Framework\Core\Model\ChatCommand\AbstractChatCommand;
10
use Symfony\Component\Console\Input\InputArgument;
11
use Symfony\Component\Console\Input\InputInterface;
12
13
14
/**
15
 * Class Records
16
 *
17
 * @package eXpansion\Bundle\LocalRecords\ChatCommand;
18
 * @author  reaby
19
 */
20
class Jukebox extends AbstractChatCommand
21
{
22
    /** @var JukeboxPlugin */
23
    protected $jukeboxPlugin;
24
25
    /**
26
     * @inheritdoc
27
     */
28
    protected function configure()
29
    {
30
        parent::configure();
31
32
        $this->inputDefinition->addArgument(
33
            new InputArgument('action', InputArgument::REQUIRED, 'expansion_jukebox.chat.command.jukebox.description')
34
        );
35
    }
36
37
    public function getHelp()
38
    {
39
        return 'expansion_jukebox.chat.command.jukebox.help';
40
    }
41
42
    /**
43
     * MapsList constructor.
44
     *
45
     * @param $command
46
     * @param array $aliases
47
     * @param JukeboxPlugin $jukeboxPlugin
48
     */
49
    public function __construct(
50
        $command,
51
        array $aliases = [],
52
        JukeboxPlugin $jukeboxPlugin
53
    ) {
54
        parent::__construct($command, $aliases);
55
56
        $this->jukeboxPlugin = $jukeboxPlugin;
57
    }
58
59
    /**
60
     * @inheritdoc
61
     */
62
    public function execute($login, InputInterface $input)
63
    {
64
        $action = $input->getArgument('action');
65
        $this->jukeboxPlugin->jukeboxCommand($login, $action);
66
    }
67
}
68