Code Duplication    Length = 48-48 lines in 2 locations

src/eXpansion/Bundle/Emotes/Plugins/MenuItems.php 1 location

@@ 16-63 (lines=48) @@
13
 * @package eXpansion\Bundle\Emotes\Plugins;
14
 * @author  oliver de Cramer <[email protected]>
15
 */
16
class MenuItems implements ListenerMenuItemProviderInterface
17
{
18
    /**
19
     * Register items tot he parent item.
20
     *
21
     * @param ParentItem $root
22
     *
23
     * @return mixed
24
     */
25
    public function registerMenuItems(ParentItem $root)
26
    {
27
        $root->addChild(
28
            ParentItem::class,
29
            'general',
30
            'expansion_menu.general.label',
31
            null
32
        );
33
        $root->addChild(
34
            ParentItem::class,
35
            'general/emotes',
36
            'expansion_emotes.menu.label',
37
            null
38
        );
39
40
        $root->addChild(
41
            ChatCommandItem::class,
42
            'general/emotes/gg',
43
            'expansion_emotes.menu.gg',
44
            null,
45
            ['cmd' => '/gg']
46
        );
47
        $root->addChild(
48
            ChatCommandItem::class,
49
            'general/emotes/bb',
50
            'expansion_emotes.menu.bb',
51
            null,
52
            ['cmd' => '/bb']
53
        );
54
        $root->addChild(
55
            ChatCommandItem::class,
56
            'general/emotes/thx',
57
            'expansion_emotes.menu.thx',
58
            null,
59
            ['cmd' => '/thx']
60
        );
61
62
    }
63
}

src/eXpansion/Bundle/LocalRecords/Plugins/MenuItems.php 1 location

@@ 16-63 (lines=48) @@
13
 * @package eXpansion\Bundle\LocalRecords\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
            '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
}