| 1 | <?php |
||
| 21 | class FakeDispatcher implements DispatcherInterface |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * Listener collection |
||
| 25 | * @var array |
||
| 26 | */ |
||
| 27 | protected $listeners = []; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param string $name |
||
| 31 | * @param EventInterface $event |
||
| 32 | * @return EventInterface |
||
| 33 | */ |
||
| 34 | public function dispatch($name, EventInterface $event) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Add a listener for the given event |
||
| 49 | * @param string $name |
||
| 50 | * @param Callable $listener |
||
| 51 | * @param int $priority |
||
| 52 | * @return DispatcherInterface |
||
| 53 | */ |
||
| 54 | public function add($name, callable $listener, $priority = 0) |
||
| 60 | |||
| 61 | public function remove($name, callable $listener) |
||
| 67 | } |
||
| 68 |