Code Duplication    Length = 43-48 lines in 2 locations

src/eXpansion/Bundle/Maps/ChatCommand/Jukebox.php 1 location

@@ 20-67 (lines=48) @@
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

src/eXpansion/Bundle/Maps/ChatCommand/Remove.php 1 location

@@ 19-61 (lines=43) @@
16
 * @author  Reaby
17
 *
18
 */
19
class Remove extends AdminChatCommand
20
{
21
22
    /** @var  Maps */
23
    protected $plugin;
24
25
    public function __construct(
26
        $command,
27
        $permission,
28
        $aliases = [],
29
        AdminGroups $adminGroupsHelper,
30
        Maps $plugin
31
    ) {
32
        parent::__construct($command, $permission, $aliases, $adminGroupsHelper);
33
        $this->plugin = $plugin;
34
    }
35
36
37
    public function getDescription()
38
    {
39
        return 'expansion_mx.command.remove.description';
40
    }
41
42
    protected function configure()
43
    {
44
        parent::configure();
45
46
        $this->inputDefinition->addArgument(
47
            new InputArgument('index', InputArgument::REQUIRED, 'expansion_mx.command.remove.index')
48
        );
49
50
    }
51
52
    /**
53
     * @inheritdoc
54
     */
55
    public function execute($login, InputInterface $input)
56
    {
57
        $index = $input->getArgument('index');
58
        $this->plugin->removeMap($login, $index);
59
    }
60
61
}
62
63
64