<?php
 namespace Eluceo\iCal\Domain\Collection; use BadMethodCallException; use Eluceo\iCal\Domain\Entity\Event; use Iterator; final class EventsGenerator extends Events { private Iterator $generator; public function __construct(Iterator $generator) { $this->generator = $generator; } public function getIterator(): Iterator { return $this->generator; } public function addEvent(Event $event): void { throw new BadMethodCallException('Events cannot be added to an EventsGenerator.'); } } 