Skip to content
PHP Ecosystem
Explore

AssetSnapshot

API reference › Debug Core › Panel › Asset › AssetSnapshot

final readonly classPHPForge\Debug\Panel\Asset\AssetSnapshot
ImplementsPHPForge\Debug\Storage\PanelSnapshot
Sourcesrc/Panel/Asset/AssetSnapshot.php

Canonical Asset panel snapshot holding the registered bundles and the Vite manifest in their typed form.

MethodDescriptionDefined 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() staticNarrows 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
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

ParameterTypeDescription
$bundleslist<AssetBundleRow>
$viteViteManifest|null
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.

public static function fromArray(mixed $data, string $path): self

Narrows the persisted asset payload into a typed snapshot.

Parameters

ParameterTypeDescription
$datamixedPersisted payload, expected to be an object carrying a bundles list and a vite entry.
$pathstringJSON path of the payload, used to report a malformed capture.

Returns

self: Snapshot carrying the registered bundles and the Vite manifest.

public function jsonSerialize(): array<string, mixed>

Returns the panel snapshot for JSON serialization.

Returns

array<string, mixed>

public function vite(): PHPForge\Debug\Panel\Asset\ViteManifest|null

Returns the Vite manifest snapshot, or null when no Vite bridge is registered.

Returns

ViteManifest|null