1 | <?php |
||
12 | final class ProjectEnabledDispatcher implements EventDispatcher |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $listeners = []; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $sorted = []; |
||
23 | |||
24 | /** |
||
25 | * @param string $eventName |
||
26 | * @param array $arguments |
||
27 | * @param bool $runProjectionsOnly |
||
28 | */ |
||
29 | 24 | public function dispatch($eventName, array $arguments, $runProjectionsOnly = false) |
|
38 | |||
39 | /** |
||
40 | * @param string $eventName |
||
41 | * @param callable $callable |
||
42 | * @param int $priority |
||
43 | */ |
||
44 | 24 | public function addListener($eventName, callable $callable, $priority = 0) |
|
51 | |||
52 | |||
53 | /** |
||
54 | * @param Subscriber $subscriber |
||
55 | * @return void |
||
56 | */ |
||
57 | 6 | public function addSubscriber(Subscriber $subscriber) |
|
71 | |||
72 | /** |
||
73 | * @param $eventName |
||
74 | * @return array |
||
75 | */ |
||
76 | 21 | protected function getListenersInOrder($eventName) |
|
87 | |||
88 | /** |
||
89 | * Sorts the internal list of listeners for the given event by priority. |
||
90 | * |
||
91 | * @param string $eventName The name of the event. |
||
92 | */ |
||
93 | 21 | private function sortListeners($eventName) |
|
100 | } |