ConfigureMenuEvent   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 56
rs 10
c 0
b 0
f 0
ccs 14
cts 14
cp 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setFactory() 0 4 1
A getFactory() 0 4 1
A setMenu() 0 4 1
A getMenu() 0 4 1
1
<?php
2
3
namespace SumoCoders\FrameworkCoreBundle\Event;
4
5
use Knp\Menu\FactoryInterface;
6
use Knp\Menu\ItemInterface;
7
use Symfony\Component\EventDispatcher\Event;
8
9
class ConfigureMenuEvent extends Event
10
{
11
    const EVENT_NAME = 'framework_core.configure_menu';
12
13
    /**
14
     * @var \Knp\Menu\FactoryInterface
15
     */
16
    private $factory;
17
18
    /**
19
     * @var \Knp\Menu\ItemInterface
20
     */
21
    private $menu;
22
23
    /**
24
     * @param FactoryInterface $factory
25
     * @param ItemInterface    $menu
26
     */
27 13
    public function __construct(FactoryInterface $factory, ItemInterface $menu)
28
    {
29 13
        $this->setFactory($factory);
30 13
        $this->setMenu($menu);
31 13
    }
32
33
    /**
34
     * @param FactoryInterface $factory
35
     */
36 13
    private function setFactory($factory)
37
    {
38 13
        $this->factory = $factory;
39 13
    }
40
41
    /**
42
     * @return \Knp\Menu\FactoryInterface
43
     */
44 1
    public function getFactory()
45
    {
46 1
        return $this->factory;
47
    }
48
49
    /**
50
     * @param ItemInterface $menu
51
     */
52 13
    private function setMenu($menu)
53
    {
54 13
        $this->menu = $menu;
55 13
    }
56
57
    /**
58
     * @return \Knp\Menu\ItemInterface
59
     */
60 9
    public function getMenu()
61
    {
62 9
        return $this->menu;
63
    }
64
}
65