Code Duplication    Length = 24-25 lines in 2 locations

htdocs/src/Oc/Changelog/Subscriber/MenuSubscriber.php 1 location

@@ 14-37 (lines=24) @@
11
 *
12
 * @package Oc\Changelog\Subscriber
13
 */
14
class MenuSubscriber implements EventSubscriberInterface
15
{
16
    /**
17
     * Returns an array of event names this subscriber wants to listen to.
18
     *
19
     * @return array The event names to listen to
20
     */
21
    public static function getSubscribedEvents()
22
    {
23
        return [
24
            MenuEnum::MENU_MAIN => 'onConfigureMenu'
25
        ];
26
    }
27
28
    /**
29
     * @param MenuEvent $event
30
     */
31
    public function onConfigureMenu(MenuEvent $event)
32
    {
33
        $event->getCurrentItem()->addChild(
34
            'Changelog',
35
            [
36
                'route' => 'changelog.index'
37
            ]
38
        );
39
    }
40
}

htdocs/src/Oc/FieldNotes/Subscriber/MenuSubscriber.php 1 location

@@ 14-38 (lines=25) @@
11
 *
12
 * @package Oc\FieldNotes
13
 */
14
class MenuSubscriber implements EventSubscriberInterface
15
{
16
    /**
17
     * Returns an array of event names this subscriber wants to listen to.
18
     *
19
     * @return array The event names to listen to
20
     */
21
    public static function getSubscribedEvents()
22
    {
23
        return [
24
            MenuEnum::MENU_MAIN => 'onConfigureMainMenu'
25
        ];
26
    }
27
28
    /**
29
     * @param MenuEvent $event
30
     */
31
    public function onConfigureMainMenu(MenuEvent $event)
32
    {
33
        $event->getCurrentItem()->addChild(
34
            'field_notes',
35
            [
36
                'label' => 'Field-Notes',
37
                'route' => 'field_notes.index'
38
            ]
39
        );
40
    }
41
}