0 follower

Final Class Yiisoft\Yii\Debug\Storage\MemoryStorage

InheritanceYiisoft\Yii\Debug\Storage\MemoryStorage
ImplementsYiisoft\Yii\Debug\Storage\StorageInterface

Constants

Hide inherited constants

Constant Value Description Defined By
TYPE_DATA 'data' Yiisoft\Yii\Debug\Storage\StorageInterface
TYPE_OBJECTS 'objects' Yiisoft\Yii\Debug\Storage\StorageInterface
TYPE_SUMMARY 'summary' Yiisoft\Yii\Debug\Storage\StorageInterface

Method Details

Hide inherited methods

clear() public method

public void clear ( )

                public function clear(): void
{
    $this->storage = [];
}

            
read() public method

public array read ( string $type, string|null $id null )
$type string
$id string|null

                public function read(string $type, ?string $id = null): array
{
    if ($id === null) {
        return array_map(
            static fn (array $item): array => $item[$type] ?? [],
            $this->storage,
        );
    }
    return [$id => $this->storage[$id][$type] ?? []];
}

            
write() public method

public void write ( string $id, array $data, array $objectsMap, array $summary )
$id string
$data array
$objectsMap array
$summary array

                public function write(string $id, array $data, array $objectsMap, array $summary): void
{
    $this->storage[$id] = [
        'data' => $data,
        'objects' => $objectsMap,
        'summary' => $summary,
    ];
}