| 1 | <?php |
||
| 9 | class ReleaseRecordedEventsMiddleware implements Middleware |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var ContainsRecordedEvents |
||
| 13 | */ |
||
| 14 | private $eventRecorder; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var EventDispatcherInterface |
||
| 18 | */ |
||
| 19 | private $eventDispatcher; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * ReleaseRecorderEventsMiddleware constructor. |
||
| 23 | * |
||
| 24 | * @param ContainsRecordedEvents $eventRecorder |
||
| 25 | * @param EventDispatcherInterface $eventDispatcher |
||
| 26 | */ |
||
| 27 | public function __construct(ContainsRecordedEvents $eventRecorder, EventDispatcherInterface $eventDispatcher) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Dispatches all the recorded events in the EventBus and erases them |
||
| 35 | * |
||
| 36 | * @param object $command |
||
| 37 | * @param callable $next |
||
| 38 | * |
||
| 39 | * @return void |
||
| 40 | * |
||
| 41 | * @throws \Exception |
||
| 42 | */ |
||
| 43 | public function execute($command, callable $next) |
||
| 59 | } |