ConfigureEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 34
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getRoot() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Veslo project <https://github.com/symfony-doge/veslo>.
5
 *
6
 * (C) 2019 Pavel Petrov <[email protected]>.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @license https://opensource.org/licenses/GPL-3.0 GPL-3.0
12
 */
13
14
declare(strict_types=1);
15
16
namespace Veslo\AppBundle\Event\Menu;
17
18
use Knp\Menu\ItemInterface;
19
use Symfony\Component\EventDispatcher\Event;
20
21
/**
22
 * Menu configure event to allow a menu to be extended by different bundles
23
 */
24
class ConfigureEvent extends Event
25
{
26
    /**
27
     * Event name
28
     *
29
     * @const string
30
     */
31
    public const NAME = 'veslo.app.event.menu.configure';
32
33
    /**
34
     * Root item of application menu tree
35
     *
36
     * @var ItemInterface
37
     */
38
    private $root;
39
40
    /**
41
     * ConfigureEvent constructor.
42
     *
43
     * @param ItemInterface $root Root item of application menu tree
44
     */
45
    public function __construct(ItemInterface $root)
46
    {
47
        $this->root = $root;
48
    }
49
50
    /**
51
     * Returns a root item of application menu tree
52
     *
53
     * @return ItemInterface
54
     */
55
    public function getRoot(): ItemInterface
56
    {
57
        return $this->root;
58
    }
59
}
60