| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function execute($command, callable $next) |
||
| 35 | { |
||
| 36 | $returnValue = $next($command); |
||
| 37 | |||
| 38 | $collectDomainEventsSubscriber = DomainEventPublisher::instance()->subscriberOfClassName( |
||
| 39 | CollectInMemoryDomainEventsSubscriber::class |
||
| 40 | ); |
||
| 41 | $publishableEvents = $collectDomainEventsSubscriber->events(); |
||
| 42 | |||
| 43 | $domainEvents = array_map(function (PublishableDomainEvent $publishableDomainEvent) { |
||
| 44 | return $publishableDomainEvent->event(); |
||
| 45 | }, $publishableEvents); |
||
| 46 | |||
| 47 | $this->eventBus->publish(...$domainEvents); |
||
| 48 | |||
| 49 | return $returnValue; |
||
| 50 | } |
||
| 51 | } |
||
| 52 |