code: protected function replay(Iterator $historyEvents): void
      {
          foreach ($historyEvents as $pastEvent) {
              /** @var AggregateChanged $pastEvent */
              $this->version = $pastEvent->version();
  
              $this->apply($pastEvent);
          }
      }
docs: Replay past events
  
  @throws RuntimeException