Completed
Pull Request — master (#404)
by De Cramer
03:04
created

MenuItems::registerMenuItems()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16

Duplication

Lines 16
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 16
loc 16
ccs 0
cts 16
cp 0
rs 9.7333
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * @author    Wide Agency Dev Team
4
 * @category  eXpansion2
5
 */
6
7
namespace eXpansion\Bundle\ServerInformation\Plugins;
8
9
10
use eXpansion\Bundle\Menu\DataProviders\Listener\ListenerMenuItemProviderInterface;
11
use eXpansion\Bundle\Menu\Model\Menu\ChatCommandItem;
12
use eXpansion\Bundle\Menu\Model\Menu\ParentItem;
13
14 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...
15
{
16
17
    /**
18
     * Register items tot he parent item.
19
     *
20
     * @param ParentItem $root
21
     *
22
     * @return mixed
23
     */
24
    public function registerMenuItems(ParentItem $root)
25
    {
26
        $root->addChild(
27
            ParentItem::class,
28
            'general',
29
            'expansion_menu.general.label',
30
            null
31
        );
32
        $root->addChild(
33
            ChatCommandItem::class,
34
            'general/about',
35
            'expansion_server_information.menu.label',
36
            null,
37
            ['cmd' => '/info']
38
        );
39
    }
40
}
41