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

MenuEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 1
b 0
f 0
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