| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 72.72% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class InMemoryRepository extends SimpleRepository |
||
| 8 | { |
||
| 9 | protected Collection $items; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * InMemoryRepository constructor. |
||
| 13 | */ |
||
| 14 | public function __construct() |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * {@inheritdoc} |
||
| 21 | */ |
||
| 22 | 6 | protected function retrieve(string $key): mixed |
|
| 23 | { |
||
| 24 | 6 | return $this->items->get($key); |
|
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * {@inheritdoc} |
||
| 29 | */ |
||
| 30 | 6 | protected function store(string $key, Collection $collection): bool |
|
| 31 | { |
||
| 32 | 6 | $this->items->put($key, $collection); |
|
| 33 | |||
| 34 | 6 | return true; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritdoc} |
||
| 39 | */ |
||
| 40 | 6 | public function flush(): bool |
|
| 45 | } |
||
| 46 | } |
||
| 47 |