Conditions | 4 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 8 | public function __invoke(Collection $collection) |
|
19 | { |
||
20 | 8 | $max = null; |
|
21 | 8 | foreach ($collection as $element) { |
|
22 | 7 | $value = ObjectFunctions::getPropertyValue($element, $this->fieldName); |
|
23 | 7 | if ($max === null || $max < $value) { |
|
24 | 7 | $max = $value; |
|
25 | } |
||
26 | } |
||
27 | 8 | return $max; |
|
28 | } |
||
30 |