1 | <?php |
||
21 | abstract class AbstractDispatcherAdapter implements DispatcherInterface |
||
22 | { |
||
23 | /** |
||
24 | * Adapted instance |
||
25 | */ |
||
26 | protected $dispatcher; |
||
27 | |||
28 | /** |
||
29 | * @param string $name |
||
30 | * @param EventInterface $event |
||
31 | * @return EventInterface |
||
32 | */ |
||
33 | public function dispatch($name, EventInterface $event) |
||
42 | |||
43 | /** |
||
44 | * Add a listener for the given event |
||
45 | * @param string $name |
||
46 | * @param Callable $listener |
||
47 | * @param int $priority |
||
48 | * @return DispatcherInterface |
||
49 | */ |
||
50 | abstract public function add($name, callable $listener, $priority = 0); |
||
51 | |||
52 | /** |
||
53 | * Add a listener for the given event |
||
54 | * @param string $name |
||
55 | * @param Callable $listener |
||
56 | * @return DispatcherInterface |
||
57 | */ |
||
58 | abstract public function remove($name, callable $listener); |
||
59 | |||
60 | /** |
||
61 | * Retrieve the listeners for a given event name |
||
62 | * @param string $name |
||
63 | * @return array |
||
64 | */ |
||
65 | abstract public function get($name); |
||
66 | } |
||
67 |