AssetSnapshot
API reference › Debug Core › Panel › Asset › AssetSnapshot
Canonical Asset panel snapshot holding the registered bundles and the Vite manifest in their typed form.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates an asset snapshot from bundles and an optional Vite manifest. | AssetSnapshot |
bundles() | Returns the asset bundles registered during the request. | AssetSnapshot |
fromArray() static | Narrows the persisted asset payload into a typed snapshot. | AssetSnapshot |
jsonSerialize() | Returns the panel snapshot for JSON serialization. | AssetSnapshot |
vite() | Returns the Vite manifest snapshot, or null when no Vite bridge is registered. | AssetSnapshot |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(list<PHPForge\Debug\Panel\Asset\AssetBundleRow> $bundles, PHPForge\Debug\Panel\Asset\ViteManifest|null $vite)Creates an asset snapshot from bundles and an optional Vite manifest.
Parameters
| Parameter | Type | Description |
|---|---|---|
$bundles | list<AssetBundleRow> | |
$vite | ViteManifest| |
bundles()
Section titled “bundles() ”public function bundles(): list<PHPForge\Debug\Panel\Asset\AssetBundleRow>Returns the asset bundles registered during the request.
Returns
list<AssetBundleRow>: Registered bundles in registration order.
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows the persisted asset payload into a typed snapshot.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted payload, expected to be an object carrying a bundles list and a vite entry. |
$path | string | JSON path of the payload, used to report a malformed capture. |
Returns
self: Snapshot carrying the registered bundles and the Vite manifest.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the panel snapshot for JSON serialization.
Returns
array<string, mixed>
vite()
Section titled “vite() ”public function vite(): PHPForge\Debug\Panel\Asset\ViteManifest|nullReturns the Vite manifest snapshot, or null when no Vite bridge is registered.
Returns
ViteManifest|null