Completed
Pull Request — master (#151)
by De Cramer
03:02
created

MenuItems   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 41
ccs 0
cts 25
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B registerMenuItems() 0 30 1
1
<?php
2
3
4
namespace eXpansion\Bundle\Maps\Plugins;
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
9
10
/**
11
 * Class MenuItems
12
 *
13
 * @package eXpansion\Bundle\Maps\Plugins;
14
 * @author  oliver de Cramer <[email protected]>
15
 */
16
class MenuItems implements ListenerMenuItemProviderInterface
17
{
18
19
    /**
20
     * Register items tot he parent item.
21
     *
22
     * @param ParentItem $root
23
     *
24
     * @return mixed
25
     */
26
    public function registerMenuItems(ParentItem $root)
27
    {
28
        $root->addChild(
29
            ParentItem::class,
30
            'maps',
31
            'expansion_maps.menu.label',
32
            null
33
        );
34
        $root->addChild(
35
            ChatCommandItem::class,
36
            'maps/list',
37
            'expansion_maps.menu.list',
38
            null,
39
            ['cmd' => '/list']
40
        );
41
        $root->addChild(
42
            ChatCommandItem::class,
43
            'maps/jukebox',
44
            'expansion_maps.menu.jukebox',
45
            null,
46
            ['cmd' => '/jukebox']
47
        );
48
        $root->addChild(
49
            ChatCommandItem::class,
50
            'maps/searchmx',
51
            'expansion_maps.menu.searchmx',
52
            null,
53
            ['cmd' => '/admin search']
54
        );
55
    }
56
}