Completed
Push — master ( 3b2ceb...02eb7f )
by De Cramer
12s
created

MenuItems::registerMenuItems()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 37
Code Lines 30

Duplication

Lines 37
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 37
loc 37
ccs 0
cts 31
cp 0
rs 8.8571
cc 1
eloc 30
nc 1
nop 1
crap 2
1
<?php
2
3
namespace eXpansion\Bundle\LocalRecords\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
9
10
/**
11
 * Class MenuItems
12
 *
13
 * @package eXpansion\Bundle\LocalRecords\Plugins;
14
 * @author  oliver de Cramer <[email protected]>
15
 */
16 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...
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
            'records',
31
            'expansion_local_records.menu.label',
32
            null // Permission are handled by sub elements.
33
        );
34
        $root->addChild(
35
            ChatCommandItem::class,
36
            'records/list',
37
            'expansion_local_records.menu.race_recs',
38
            null,
39
            ['cmd' => '/recs']
40
        );
41
        $root->addChild(
42
            ChatCommandItem::class,
43
            'records/laps',
44
            'expansion_local_records.menu.laps_recs',
45
            null,
46
            ['cmd' => '/dummy']
47
        );
48
        $root->addChild(
49
            ChatCommandItem::class,
50
            'records/prev_list',
51
            'expansion_local_records.menu.prev.race_recs',
52
            null,
53
            ['cmd' => '/dummy']
54
        );
55
        $root->addChild(
56
            ChatCommandItem::class,
57
            'records/prev_laps',
58
            'expansion_local_records.menu.prev.laps_recs',
59
            null,
60
            ['cmd' => '/dummy']
61
        );
62
    }
63
}