Completed
Push — refonte ( 1242fa...069864 )
by Arnaud
13:36 queued 11:30
created

Menu::getContainerCssClasses()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace LAG\AdminBundle\Menu;
4
5
use LAG\AdminBundle\Configuration\MenuConfiguration;
6
7
class Menu
8
{
9
    /**
10
     * @var MenuItem[]
11
     */
12
    private $items = [];
13
14
    /**
15
     * @var string
16
     */
17
    private $name;
18
19
    /**
20
     * @var MenuConfiguration
21
     */
22
    private $configuration;
23
24
    /**
25
     * Menu constructor.
26
     *
27
     * @param string            $name
28
     * @param MenuConfiguration $configuration
29
     */
30
    public function __construct(string $name, MenuConfiguration $configuration)
31
    {
32
        $this->name = $name;
33
        $this->configuration = $configuration;
34
    }
35
36
    public function addItem(MenuItem $item)
37
    {
38
        $this->items[] = $item;
39
    }
40
41
    /**
42
     * @return MenuItem[]
43
     */
44
    public function getItems(): array
45
    {
46
        return $this->items;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getName(): string
53
    {
54
        return $this->name;
55
    }
56
57
    /**
58
     * @param string $parameter
59
     *
60
     * @return mixed
61
     */
62
    public function get(string $parameter)
63
    {
64
        return $this->configuration->getParameter($parameter);
65
    }
66
}
67