| Conditions | 3 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | 1 | private function findLatestDateTimeFromNews(Company $company): string |
|
| 39 | { |
||
| 40 | 1 | $reduced = array_reduce( |
|
| 41 | 1 | (array) $company->info($this->companyKey), |
|
| 42 | 1 | function (?array $carry, array $current): array { |
|
| 43 | 1 | if (null === $carry) { |
|
|
|
|||
| 44 | 1 | return $current; |
|
| 45 | } |
||
| 46 | |||
| 47 | 1 | return $carry[$this->keyToCompare] > $current[$this->keyToCompare] |
|
| 48 | 1 | ? $carry |
|
| 49 | 1 | : $current; |
|
| 50 | 1 | } |
|
| 51 | ); |
||
| 52 | |||
| 53 | 1 | return $reduced[$this->keyToCompare]; |
|
| 54 | } |
||
| 56 |