1 | <?php |
||
7 | final class EventListener |
||
8 | { |
||
9 | /** |
||
10 | * @var bool |
||
11 | */ |
||
12 | private $asynchronous; |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $eventClassName; |
||
17 | |||
18 | /** |
||
19 | * @var callable|string |
||
20 | */ |
||
21 | private $method; |
||
22 | |||
23 | /** |
||
24 | * @param callable|string $method |
||
25 | * @param string|null $eventClassName |
||
26 | * @param bool $asynchronous |
||
27 | */ |
||
28 | public function __construct($method, $eventClassName = null, $asynchronous = false) |
||
37 | |||
38 | /** |
||
39 | * @param bool $asynchronous |
||
40 | */ |
||
41 | public static function validateAsynchronous($asynchronous) |
||
47 | |||
48 | /** |
||
49 | * @param string|null $eventClassName |
||
50 | */ |
||
51 | public static function validateEventClassName($eventClassName) |
||
57 | |||
58 | /** |
||
59 | * @param string|callable $method |
||
60 | */ |
||
61 | public static function validateMethod($method) |
||
67 | |||
68 | /** |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function isAsynchronous() |
||
75 | |||
76 | /** |
||
77 | * @param EventSubscriberInterface $subscriber |
||
78 | */ |
||
79 | public function setSubscriber(EventSubscriberInterface $subscriber) |
||
85 | |||
86 | /** |
||
87 | * @return string |
||
88 | */ |
||
89 | public function getEventClassName() |
||
93 | |||
94 | /** |
||
95 | * @return callable|string |
||
96 | */ |
||
97 | public function getMethod() |
||
101 | } |
||
102 |