Total Complexity | 3 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
10 | final class InMemoryMatches implements Matches |
||
11 | { |
||
12 | /** @var Match[] */ |
||
13 | private $matches = []; |
||
14 | |||
15 | public function add(Match $match): void |
||
16 | { |
||
17 | $this->matches[(string) $match->id()] = $match; |
||
18 | } |
||
19 | |||
20 | public function withId(MatchId $match): Match |
||
21 | { |
||
22 | // @todo throw if no such match |
||
23 | return $this->matches[$match->id()]; |
||
24 | } |
||
25 | |||
26 | public function ongoing(): array |
||
30 | } |
||
31 | } |
||
32 |