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

MenuEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 32
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMenu() 0 3 1
A getName() 0 3 1
1
<?php
2
3
namespace LAG\AdminBundle\Event\Menu;
4
5
use LAG\AdminBundle\Menu\Menu;
6
use Symfony\Component\EventDispatcher\Event;
7
8
class MenuEvent extends Event
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

8
class MenuEvent extends /** @scrutinizer ignore-deprecated */ Event
Loading history...
9
{
10
    /**
11
     * @var string
12
     */
13
    private $name;
14
15
    /**
16
     * @var Menu
17
     */
18
    private $menu;
19
20
    public function __construct(string $name, Menu $menu)
21
    {
22
        $this->name = $name;
23
        $this->menu = $menu;
24
    }
25
26
    /**
27
     * @return string
28
     */
29
    public function getName(): string
30
    {
31
        return $this->name;
32
    }
33
34
    /**
35
     * @return Menu
36
     */
37
    public function getMenu(): Menu
38
    {
39
        return $this->menu;
40
    }
41
}
42