Lines
100.00%
2 / 2
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| getIterator | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 16 | final readonly class CityIterator implements IteratorAggregate | |
| 17 | { | |
| 18 | public function __construct( | |
| 19 | private CityRepository $cityRepository, | |
| 20 | ) { | |
| 21 | } | |
| 22 | ||
| 23 | /** | |
| 24 | * @return Traversable<City> | |
| 25 | */ | |
| 26 | public function getIterator(): Traversable | |
| 27 | { | |
| 28 | return new ArrayIterator($this->cityRepository->list()); | |
| 29 | } | |
| 30 | } |