# SnapshotReadResult

> Exposes a snapshot read together with an optional storage diagnostic.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Storage](/docs/extensions/debug-core/reference/storage/index.md) › SnapshotReadResult

| final readonly class | `PHPForge\Debug\Storage\SnapshotReadResult` |
| --- | --- |
| Source | [`src/Storage/SnapshotReadResult.php`](https://github.com/php-forge/debug-core/blob/main/src/Storage/SnapshotReadResult.php#L10) |

Exposes a snapshot read together with an optional storage diagnostic.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-error"></span>`$error` readonly constructor | [`StorageException`](/docs/extensions/debug-core/reference/storage/storageexception/index.md)`\|null` | The storage error, if any. | `SnapshotReadResult` |
| <span id="property-snapshot"></span>`$snapshot` readonly constructor | [`DebugSnapshot`](/docs/extensions/debug-core/reference/storage/debugsnapshot/index.md)`\|null` | The read snapshot, if available. | `SnapshotReadResult` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates a snapshot read result with an optional diagnostic. | `SnapshotReadResult` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(PHPForge\Debug\Storage\DebugSnapshot|null $snapshot, PHPForge\Debug\Storage\StorageException|null $error)
```

Creates a snapshot read result with an optional diagnostic.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$snapshot` | [`DebugSnapshot`](/docs/extensions/debug-core/reference/storage/debugsnapshot/index.md)`\|null` | The read snapshot, if available. |
| `$error` | [`StorageException`](/docs/extensions/debug-core/reference/storage/storageexception/index.md)`\|null` | The storage error, if any. |