Total Complexity | 4 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | final class MinAggregator extends UniqueNumericAggregator |
||
14 | { |
||
15 | |||
16 | 2 | protected function aggregateNumericData(array $dataList, ScalarValueInterface ...$elements): ?ValueInterface |
|
17 | { |
||
18 | 2 | $elementIndex = $this->findElementIndex($dataList); |
|
19 | 2 | if (isset($elementIndex, $elements[$elementIndex])) { |
|
20 | 2 | return $elements[$elementIndex]; |
|
21 | } |
||
22 | |||
23 | // @codeCoverageIgnoreStart |
||
24 | throw new Exception\MaxElementNotFoundException($dataList, $elements); |
||
25 | // @codeCoverageIgnoreEnd |
||
26 | } |
||
27 | |||
28 | 2 | private function findElementIndex(array $dataList): ?int |
|
33 | } |
||
34 | } |
||
35 |