/** * Add the given events to the stream and assign a sequence number to them. * * @param Stream $stream * @param Stream\Event[] $uncommittedEvents * * @return void */ public function persist(Stream $stream, array $uncommittedEvents) { foreach ($uncommittedEvents as &$event) { $event = $event->withStream($stream); } $this->storage->persist($uncommittedEvents); }