| Total Complexity | 8 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | final class MemoryStorage implements StorageInterface |
||
| 12 | { |
||
| 13 | private DebuggerIdGenerator $idGenerator; |
||
| 14 | /** |
||
| 15 | * @var CollectorInterface[] |
||
| 16 | */ |
||
| 17 | private array $collectors = []; |
||
| 18 | |||
| 19 | 29 | public function __construct(DebuggerIdGenerator $idGenerator) |
|
| 22 | 29 | } |
|
| 23 | |||
| 24 | 26 | public function addCollector(CollectorInterface $collector): void |
|
| 27 | 26 | } |
|
| 28 | |||
| 29 | 8 | public function read($type = self::TYPE_INDEX): array |
|
| 30 | { |
||
| 31 | 8 | if ($type === self::TYPE_INDEX) { |
|
| 32 | 8 | return [$this->idGenerator->getId() => $this->getData()]; |
|
| 33 | } |
||
| 34 | |||
| 35 | 8 | return $this->getData(); |
|
| 36 | } |
||
| 37 | |||
| 38 | 24 | public function getData(): array |
|
| 47 | } |
||
| 48 | |||
| 49 | 17 | public function flush(): void |
|
| 52 | 17 | } |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @codeCoverageIgnore |
||
| 56 | */ |
||
| 57 | public function clear(): void |
||
| 61 |