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

Jukebox::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 8
cp 0
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 3
crap 2
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