| Conditions | 3 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 2 | private function findLatestDateTimeFromNews(Quote $quote): string |
|
| 34 | { |
||
| 35 | 2 | $reduced = array_reduce( |
|
| 36 | 2 | $quote->getLatestNews(), |
|
| 37 | 2 | static function (?News $carry, News $current): News { |
|
| 38 | 2 | if ($carry === null) { |
|
| 39 | 2 | return $current; |
|
| 40 | } |
||
| 41 | |||
| 42 | 2 | return $carry->getDatetime() > $current->getDatetime() |
|
| 43 | 2 | ? $carry |
|
| 44 | 2 | : $current; |
|
| 45 | 2 | }, |
|
| 46 | ); |
||
| 47 | |||
| 48 | 2 | return $reduced->getDatetime() ?? ''; |
|
| 49 | } |
||
| 51 |