| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class InMemoryHistoryDao implements HistoryDaoInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var History[] |
||
| 15 | */ |
||
| 16 | private array $histories; |
||
| 17 | |||
| 18 | public function __construct(History ...$history) |
||
| 19 | { |
||
| 20 | $this->histories = array_reduce( |
||
| 21 | $history, |
||
| 22 | static function (array $histories, History $history): array { |
||
| 23 | $histories[(string) $history->historyId()] = $history; |
||
| 24 | |||
| 25 | return $histories; |
||
| 26 | }, |
||
| 27 | [] |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function ratingHistory(int $limit = self::LIMIT): array |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return History[] |
||
| 41 | */ |
||
| 42 | public function histories(): array |
||
| 45 | } |
||
| 46 | } |
||
| 47 |