| Total Complexity | 6 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | final class BaseStorage implements Storage |
||
| 11 | { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Ctor. |
||
| 15 | * |
||
| 16 | * @param array $stored |
||
| 17 | */ |
||
| 18 | public function __construct( |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritDoc} |
||
| 30 | */ |
||
| 31 | public function added(Iterator $source): static |
||
| 32 | { |
||
| 33 | $this->stored[$source->key()] = $source->current(); |
||
| 34 | return $this; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritDoc} |
||
| 39 | */ |
||
| 40 | public function value(): mixed |
||
| 41 | { |
||
| 42 | return current($this->stored); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * {@inheritDoc} |
||
| 47 | */ |
||
| 48 | public function key(): mixed |
||
| 51 | } |
||
| 52 | |||
| 53 | public function rewind(): static |
||
| 54 | { |
||
| 55 | return $this; |
||
| 56 | } |
||
| 57 | |||
| 58 | public function next(): static |
||
| 61 | } |
||
| 62 | } |
||
| 63 |