Passed
Pull Request — master (#138)
by Arnaud
08:18 queued 05:22
created

MenuItem   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
A __construct() 0 3 1
A getConfiguration() 0 3 1
A getPosition() 0 3 1
A getName() 0 3 1
1
<?php
2
3
namespace LAG\AdminBundle\Menu;
4
5
use LAG\AdminBundle\Configuration\MenuItemConfiguration;
6
7
class MenuItem
8
{
9
    /**
10
     * @var MenuItemConfiguration
11
     */
12
    private $configuration;
13
14
    /**
15
     * MenuItem constructor.
16
     */
17
    public function __construct(MenuItemConfiguration $configuration)
18
    {
19
        $this->configuration = $configuration;
20
    }
21
22
    public function getConfiguration(): MenuItemConfiguration
23
    {
24
        return $this->configuration;
25
    }
26
27
    /**
28
     * @return mixed
29
     */
30
    public function get(string $parameter)
31
    {
32
        return $this->configuration->get($parameter);
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getName(): string
39
    {
40
        return $this->configuration->getName();
41
    }
42
43
    /**
44
     * @return string|null
45
     */
46
    public function getPosition(): ?string
47
    {
48
        return $this->configuration->getPosition();
49
    }
50
}
51