src/EventSourcing/DBAL/AggregateAwareDBALEventStore.php
private function guardStream(DomainEventStreamInterface $eventStream)
    {
        foreach ($eventStream as $domainMessage) {
            /** @var DomainMessage $domainMessage */
            $id = (string) $domainMessage->getId();
        }
    }
private function guardStream(DomainEventStreamInterface $eventStream)
    {
        foreach ($eventStream as $domainMessage) {
            /** @var DomainMessage $domainMessage */
            $id = (string) $domainMessage->getId();
        }
    }
private function guardStream ( DomainEventStreamInterface $ eventStream ) { foreach ( $ eventStream as $ domainMessage ) { /** @var DomainMessage $domainMessage */ $ id = ( string ) $ domainMessage -> getId ( ) ; } }
Ensure that an error will be thrown if the ID in the domain messages is
not something that can be converted to a string.

If we let this move on without doing this DBAL will eventually
give us a hard time but the true reason for the problem will be
obfuscated.

@param DomainEventStreamInterface $eventStream
Ensure that an error will be thrown if the ID in the domain messages is not something that can be converted to a string .