Completed
Push — development ( 0937b7...1a7c5e )
by Thomas
21s
created

MenuSubscriber::onConfigureMenu()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 7
Ratio 77.78 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 7
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
namespace Oc\Changelog\Subscriber;
4
5
use Oc\Menu\Event\MenuEvent;
6
use Oc\Menu\MenuEnum;
7
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
8
9
/**
10
 * Class MenuSubscriber
11
 *
12
 * @package Oc\Changelog\Subscriber
13
 */
14 View Code Duplication
class MenuSubscriber implements EventSubscriberInterface
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
     * 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
}
41