Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function execute($command, callable $next) |
||
24 | { |
||
25 | $domainEventPublisher = DomainEventPublisher::instance(); |
||
26 | $collectDomainEventsSubscriber = new CollectlDomainEventsSubscriber(); |
||
27 | $domainEventPublisher->subscribe($collectDomainEventsSubscriber); |
||
28 | |||
29 | $returnValue = $next($command); |
||
30 | |||
31 | $domainEvents = $collectDomainEventsSubscriber->events(); |
||
32 | foreach ($domainEvents as $domainEvent) { |
||
33 | $domainEventPublisher->publish($domainEvent); |
||
34 | } |
||
35 | |||
36 | return $returnValue; |
||
37 | } |
||
38 | } |
||
39 |