| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | final class IterableMetricSource implements \IteratorAggregate, MetricSourceInterface |
||
| 9 | { |
||
| 10 | /** @var MetricInterface[]|\Traversable|iterable */ |
||
| 11 | private $metrics; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @param iterable|MetricInterface[] $metrics |
||
| 15 | */ |
||
| 16 | 2 | public function __construct(iterable $metrics) |
|
| 17 | { |
||
| 18 | 2 | if (\is_array($metrics)) { |
|
| 19 | 1 | $metrics = new \ArrayIterator($metrics); |
|
| 20 | } |
||
| 21 | |||
| 22 | 2 | $this->metrics = $metrics; |
|
| 23 | 2 | } |
|
| 24 | |||
| 25 | /** {@inheritdoc} */ |
||
| 26 | 2 | public function getMetrics(): \Traversable |
|
| 29 | } |
||
| 30 | |||
| 31 | /** {@inheritdoc} */ |
||
| 32 | 2 | public function getIterator(): \Traversable |
|
| 35 | } |
||
| 36 | } |
||
| 37 |