public function toDomainEvents(): DomainEvents {
        return DomainEvents::make($this->map(function (StreamEvent $streamEvent) {
            return $streamEvent->event();
        })->toArray());
    }
public function toDomainEvents(): DomainEvents {
        return DomainEvents::make($this->map(function (StreamEvent $streamEvent) {
            return $streamEvent->event();
        })->toArray());
    }
public function toDomainEvents ( ) : DomainEvents { return DomainEvents :: make ( $ this -> map ( function ( StreamEvent $ streamEvent ) { return $ streamEvent -> event ( ) ; } ) -> toArray ( ) ) ; }
return a DomainEvents collection containing the domain
events from within this stream events collection

@return DomainEvents
return a DomainEvents collection containing the domain events from within this stream events collection