Completed
Push — master ( f3c5a2...9c66df )
by WEBEWEB
02:13
created

ToastEvent::__construct()   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 2
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2019 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\Bundle\CoreBundle\Toast\ToastInterface;
15
16
/**
17
 * Toast event.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\CoreBundle\Event
21
 */
22
class ToastEvent extends AbstractEvent {
23
24
    /**
25
     * Toast.
26
     *
27
     * @var ToastInterface
28
     */
29
    private $toast;
30
31
    /**
32
     * Constructor.
33
     *
34
     * @param string $eventName The event name.
35
     * @param ToastInterface $toast The toast.
36
     */
37
    public function __construct($eventName, ToastInterface $toast) {
38
        parent::__construct($eventName);
39
        $this->setToast($toast);
40
    }
41
42
    /**
43
     * Get the toast.
44
     *
45
     * @return ToastInterface Returns the toast.
46
     */
47
    public function getToast() {
48
        return $this->toast;
49
    }
50
51
    /**
52
     * Set the toast.
53
     *
54
     * @param ToastInterface $toast The toast.
55
     * @return ToastEvent Returns this toast event.
56
     */
57
    protected function setToast(ToastInterface $toast) {
58
        $this->toast = $toast;
59
        return $this;
60
    }
61
}
62