| 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 |
||
| 21 | 8 | public function __invoke(Collection $collection) |
|
| 22 | { |
||
| 23 | 8 | $max = null; |
|
| 24 | 8 | foreach ($collection as $element) { |
|
| 25 | 7 | $value = ObjectFunctions::getPropertyValue($element, $this->fieldName); |
|
| 26 | 7 | if ($max === null || $max < $value) { |
|
| 27 | 7 | $max = $value; |
|
| 28 | } |
||
| 29 | } |
||
| 30 | 8 | return $max; |
|
| 31 | } |
||
| 33 |