Completed
Pull Request — master (#16)
by Jacek
08:07 queued 05:58
created

ListenerException::getEvent()   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
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Copyright (c) 2016 Jacek Kobus <[email protected]>
5
 * See the file LICENSE.md for copying permission.
6
 */
7
8
namespace PHPExtra\EventManager\Exception;
9
10
use PHPExtra\EventManager\Event\Event;
11
use PHPExtra\EventManager\Listener\Listener;
12
13
/**
14
 * The EventException class
15
 *
16
 * @author Jacek Kobus <[email protected]>
17
 */
18
class ListenerException extends \RuntimeException
19
{
20
    /**
21
     * @var Event
22
     */
23
    private $event;
24
25
    /**
26
     * @var Listener
27
     */
28
    private $listener;
29
30
    /**
31
     * @param Event      $event
32
     * @param Listener   $listener
33
     * @param string     $message
34
     * @param \Exception $previous
35
     */
36
    public function __construct(Event $event, Listener $listener, $message, \Exception $previous = null)
37
    {
38
        $this->event = $event;
39
        $this->listener = $listener;
40
41
        parent::__construct($message, 1, $previous);
42
    }
43
44
    /**
45
     * @return Event
46
     */
47
    public function getEvent()
48
    {
49
        return $this->event;
50
    }
51
52
    /**
53
     * @return Listener
54
     */
55
    public function getListener()
56
    {
57
        return $this->listener;
58
    }
59
}