Skip to content
PHP Ecosystem
Explore

AssetBundleRow

API reference › Debug Core › Panel › Asset › AssetBundleRow

final readonly classPHPForge\Debug\Panel\Asset\AssetBundleRow
ImplementsPHPForge\Debug\Storage\PanelRow
Sourcesrc/Panel/Asset/AssetBundleRow.php

Typed asset-bundle row narrowed once from the live AssetBundle and persisted in that form.

PropertyTypeDescriptionDefined by
$basePath readonly constructorstringPublished base path, or '' when the bundle was never published.AssetBundleRow
$baseUrl readonly constructorstringPublished base URL, or '' when the bundle was never published.AssetBundleRow
$css readonly constructorlist<string>CSS files declared by the bundle.AssetBundleRow
$depends readonly constructorlist<string>Bundle class names this bundle depends on.AssetBundleRow
$js readonly constructorlist<string>JavaScript files declared by the bundle.AssetBundleRow
$name readonly constructorstringBundle class name as registered on the asset manager.AssetBundleRow
$sourcePath readonly constructorstringSource path declared by the bundle, or '' when it publishes nothing.AssetBundleRow
MethodDescriptionDefined by
__construct()Creates an asset-bundle row from its captured metadata.AssetBundleRow
fromArray() staticNarrows one persisted bundle of the asset payload into a typed row.AssetBundleRow
fromBundle() staticNarrows one live asset bundle into a typed row.AssetBundleRow
jsonSerialize()Returns the typed row for JSON serialization.AssetBundleRow
public function __construct(string $name, string $sourcePath, string $basePath, string $baseUrl, array $css, array $js, array $depends)

Creates an asset-bundle row from its captured metadata.

Parameters

ParameterTypeDescription
$namestring
$sourcePathstring
$basePathstring
$baseUrlstring
$cssarray
$jsarray
$dependsarray
public static function fromArray(mixed $data, string $path): self

Narrows one persisted bundle of the asset payload into a typed row.

Parameters

ParameterTypeDescription
$datamixedPersisted bundle, expected to be an object carrying the declared shape.
$pathstringJSON path of the bundle, used to report a malformed payload.

Returns

self: Row carrying every persisted bundle field.

public static function fromBundle(string $name, array<array-key, mixed> $bundle): self

Narrows one live asset bundle into a typed row.

Parameters

ParameterTypeDescription
$namestring
$bundlearray<array-key, mixed>Serialized bundle properties.

Returns

self

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

Returns the typed row for JSON serialization.

Returns

array<string, mixed>