| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | public function handle($message, callable $next) |
||
| 48 | { |
||
| 49 | $next($message); |
||
| 50 | $events = $this->collectsEventsFromEntities->recordedMessages(); |
||
| 51 | $count = count($events); |
||
| 52 | $this->logger->debug('MonitorsDomainEvents saw '.$count.' events'); |
||
| 53 | |||
| 54 | if ($count) { |
||
| 55 | throw new Exception( |
||
| 56 | sprintf( |
||
| 57 | '%s Domain Events have been collected but will not be notified. |
||
| 58 | You should not raise domain event during the handling of a Event message but only for a Command.' |
||
| 59 | ) |
||
| 60 | ); |
||
| 61 | } |
||
| 62 | } |
||
| 63 | } |
||
| 64 |