Ensure the correct event is returned

This commit is contained in:
Oliver Davies 2025-06-11 09:54:18 +01:00
parent 4715d02ae0
commit 08fc6c66be
3 changed files with 28 additions and 5 deletions

View file

@ -17,6 +17,10 @@ readonly final class EventCollection implements \IteratorAggregate {
public function __construct(private array $events) {
}
public function first(): ParagraphInterface {
return array_values($this->events)[0];
}
public function getIterator(): \Traversable {
return new \ArrayIterator($this->events);
}