NotificationEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Event;
13
14
use WBW\Library\Symfony\Assets\NotificationInterface;
15
use WBW\Library\Symfony\Assets\NotificationTrait;
16
17
/**
18
 * Notification event.
19
 *
20
 * @author webeweb <https://github.com/webeweb>
21
 * @package WBW\Bundle\CoreBundle\Event
22
 */
23
class NotificationEvent extends AbstractEvent {
24
25
    use NotificationTrait;
26
27
    /**
28
     * Event "danger".
29
     *
30
     * @var string
31
     */
32
    const DANGER = "wbw.core.event.notification.danger";
33
34
    /**
35
     * Event "info".
36
     *
37 50
     * @var string
38 50
     */
39 50
    const INFO = "wbw.core.event.notification.info";
40 50
41
    /**
42
     * Event "success".
43
     *
44
     * @var string
45
     */
46
    const SUCCESS = "wbw.core.event.notification.success";
47 30
48 30
    /**
49
     * Event "warning".
50
     *
51
     * @var string
52
     */
53
    const WARNING = "wbw.core.event.notification.warning";
54
55
    /**
56
     * Constructor.
57 50
     *
58 50
     * @param string $eventName The event name.
59 50
     * @param NotificationInterface $notification The notification.
60
     */
61
    public function __construct(string $eventName, NotificationInterface $notification) {
62
        parent::__construct($eventName);
63
64
        $this->setNotification($notification);
65
    }
66
}
67