Ensure the correct event is returned
This commit is contained in:
parent
4715d02ae0
commit
08fc6c66be
3 changed files with 28 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue