| Total Complexity | 9 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class ChainStorage implements Reader |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var Reader[] |
||
| 13 | */ |
||
| 14 | private $items = []; |
||
| 15 | |||
| 16 | public function __construct(array $items = []) |
||
| 17 | { |
||
| 18 | foreach ($items as $item) { |
||
| 19 | $this->addStorage($item); |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | public function addStorage(Reader $storage): void |
||
| 24 | { |
||
| 25 | $this->items[] = $storage; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function has(string $key): bool |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @throws KeyNotFoundException |
||
| 41 | */ |
||
| 42 | public function get(string $key): Key |
||
| 51 | } |
||
| 52 | } |
||
| 53 |