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