Completed
Pull Request — master (#154)
by De Cramer
02:58
created

MenuItems::registerMenuItems()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 13

Duplication

Lines 21
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 21
loc 21
rs 9.3142
c 0
b 0
f 0
ccs 0
cts 14
cp 0
cc 1
eloc 13
nc 1
nop 1
crap 2
1
<?php
2
3
namespace eXpansion\Bundle\VoteManager\Plugins;
4
5
use eXpansion\Bundle\Menu\DataProviders\Listener\ListenerMenuItemProviderInterface;
6
use eXpansion\Bundle\Menu\Model\Menu\ChatCommandItem;
7
use eXpansion\Bundle\Menu\Model\Menu\ParentItem;
8
use FML\Controls\Quads\Quad_Icons64x64_1;
9
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
10
11
/**
12
 * Class MenuItems
13
 *
14
 * @author    de Cramer Oliver<[email protected]>
15
 * @copyright 2017 Smile
16
 * @package eXpansion\Bundle\Menu\Plugins
17
 */
18 View Code Duplication
class MenuItems implements ListenerMenuItemProviderInterface
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...
19
{
20
    /**
21
     * Register items tot he parent item.
22
     *
23
     * @param ParentItem $root
24
     *
25
     * @return mixed
26
     */
27
    public function registerMenuItems(ParentItem $root)
28
    {
29
        $root->addChild(
30
            ChatCommandItem::class,
31
            'general/restart',
32
            'expansion_votemanager.menu.restart',
33
            null,
34
            ['cmd' => '/res']
35
        );
36
37
        $root->addChild(
38
            ChatCommandItem::class,
39
            'general/skip',
40
            'expansion_votemanager.menu.skip',
41
            null,
42
            ['cmd' => '/skip']
43
        );
44
45
46
47
    }
48
}
49