| Total Complexity | 6 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 | 24 | public function __construct(DebuggerIdGenerator $idGenerator) |
|
| 22 | 24 | } |
|
| 23 | |||
| 24 | 24 | public function addCollector(CollectorInterface $collector): void |
|
| 25 | { |
||
| 26 | 24 | $this->collectors[get_class($collector)] = $collector; |
|
| 27 | 24 | } |
|
| 28 | |||
| 29 | 8 | public function read($type = self::TYPE_INDEX): array |
|
| 30 | { |
||
| 31 | 8 | return [$this->idGenerator->getId() => $this->getData()]; |
|
| 32 | } |
||
| 33 | |||
| 34 | 24 | public function getData(): array |
|
| 43 | } |
||
| 44 | |||
| 45 | 16 | public function flush(): void |
|
| 48 | 16 | } |
|
| 49 | } |
||
| 50 |