| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 80% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | final class EventDispatcherAdapter implements EventRegistry |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var EventDispatcherInterface |
||
| 14 | */ |
||
| 15 | private $dispatcher; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param EventDispatcherInterface $dispatcher |
||
| 19 | */ |
||
| 20 | 36 | public function __construct(EventDispatcherInterface $dispatcher = null) |
|
| 21 | { |
||
| 22 | 36 | if (! $dispatcher) { |
|
| 23 | 36 | $dispatcher = new EventDispatcher(); |
|
| 24 | } |
||
| 25 | 36 | $this->dispatcher = $dispatcher; |
|
| 26 | 36 | } |
|
| 27 | |||
| 28 | /** |
||
| 29 | * @param string $name |
||
| 30 | * @param StateEvent $event |
||
| 31 | */ |
||
| 32 | 23 | public function dispatch($name, StateEvent $event) |
|
| 35 | 23 | } |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $event |
||
| 39 | * @param callable $listener |
||
| 40 | */ |
||
| 41 | public function addListener($event, $listener) |
||
| 46 |