| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 6 | public function dispatchEvent(EventWithMetaData $eventWithMetadata) |
|
| 32 | { |
||
| 33 | 6 | $listeners = $this->eventSubscriber->getListenersForEvent($eventWithMetadata->getEvent()); |
|
| 34 | |||
| 35 | 6 | foreach ($listeners as $listener) { |
|
| 36 | try { |
||
| 37 | 2 | call_user_func($listener, $eventWithMetadata->getEvent(), $eventWithMetadata->getMetaData()); |
|
| 38 | 1 | } catch (\Throwable $exception) { |
|
| 39 | 1 | if ($this->logger) { |
|
| 40 | 1 | $this->logger->error( |
|
| 41 | 1 | sprintf( |
|
| 42 | 1 | "Dispatch event of type %s to %s failed: %s", |
|
| 43 | 1 | get_class($eventWithMetadata->getEvent()), |
|
| 44 | 1 | get_class($listener[0]), |
|
| 45 | 1 | $exception->getMessage()), |
|
| 46 | 2 | $exception->getTrace()); |
|
| 47 | } |
||
| 48 | } |
||
| 49 | } |
||
| 50 | } |
||
| 51 | } |