Skip to content
PHP Ecosystem
Explore

ToolbarData

API reference › Debug Core › Toolbar › ToolbarData

final readonly classPHPForge\Debug\Toolbar\ToolbarData
ImplementsJsonSerializable
Sourcesrc/Toolbar/ToolbarData.php

Represents the framework-neutral payload loaded by the debug toolbar runtime.

PropertyTypeDescriptionDefined by
$configUrl readonly constructorstringFramework configuration URL.ToolbarData
$defaultHeight readonly constructorintInitial drawer height percentage. Default: 50.ToolbarData
$iconBaseUrl readonly constructorstringBase URL for optional SVG icons. Default: ''.ToolbarData
$indexUrl readonly constructorstringDebug history URL.ToolbarData
$items readonly constructorlist<ToolbarPanel>Toolbar panels.ToolbarData
$logo readonly constructorstring|nullPrimary logo URL or null to use the fallback. Default: null.ToolbarData
$logoFallback readonly constructorstring|nullFallback logo URL or null to render the built-in mark. Default: null.ToolbarData
$phpInfoUrl readonly constructorstring|nullPHP information URL or null when unavailable. Default: null.ToolbarData
$phpVersion readonly constructorstring|nullPHP version label or null when omitted. Default: null.ToolbarData
$position readonly constructorstringInitial toolbar position. Default: 'bottom'.ToolbarData
$tag readonly constructorstringCaptured request tag.ToolbarData
$title readonly constructorstringToolbar brand title.ToolbarData
$yiiVersion readonly constructorstring|nullYii version label or null when omitted. Default: null.ToolbarData
MethodDescriptionDefined by
create() staticCreates a minimal toolbar payload ready for immutable enrichment.ToolbarData
jsonSerialize()Returns the complete payload consumed by the toolbar runtime.ToolbarData
withBranding()Returns a copy with brand assets and version labels.ToolbarData
withNavigation()Returns a copy with debugger navigation URLs.ToolbarData
withPanels()Returns a copy with toolbar panels.ToolbarData
withPresentation()Returns a copy with drawer presentation settings.ToolbarData
public static function create(string $tag, string $title): self

Creates a minimal toolbar payload ready for immutable enrichment.

Parameters

ParameterTypeDescription
$tagstring
$titlestring

Returns

self

public function jsonSerialize(): array{configUrl: string, defaultHeight: int, iconBaseUrl: string, indexUrl: string, items: list<array{id: string, title: string, items: list<array{value: string, status: string, label?: string, icon?: string, title?: string, url?: string, id?: string}>, url?: string, icon?: string, extension?: true}>, logo: string|null, logoFallback: string|null, phpInfoUrl: string|null, phpVersion: string|null, position: string, tag: string, title: string, yiiVersion: string|null}

Returns the complete payload consumed by the toolbar runtime.

Returns

array{configUrl: string, defaultHeight: int, iconBaseUrl: string, indexUrl: string, items: list<array{id: string, title: string, items: list<array{value: string, status: string, label?: string, icon?: string, title?: string, url?: string, id?: string}>, url?: string, icon?: string, extension?: true}>, logo: string|null, logoFallback: string|null, phpInfoUrl: string|null, phpVersion: string|null, position: string, tag: string, title: string, yiiVersion: string|null}: Serialized toolbar payload.

public function withBranding(string|null $logo, string|null $logoFallback, string|null $phpVersion, string|null $yiiVersion): self

Returns a copy with brand assets and version labels.

Parameters

ParameterTypeDescription
$logostring|null
$logoFallbackstring|null
$phpVersionstring|null
$yiiVersionstring|null

Returns

self

public function withNavigation(string $indexUrl, string $configUrl, string|null $phpInfoUrl): self

Returns a copy with debugger navigation URLs.

Parameters

ParameterTypeDescription
$indexUrlstring
$configUrlstring
$phpInfoUrlstring|null

Returns

self

public function withPanels(list<PHPForge\Debug\Toolbar\ToolbarPanel> $items): self

Returns a copy with toolbar panels.

Parameters

ParameterTypeDescription
$itemslist<ToolbarPanel>

Returns

self

public function withPresentation(string $position, int $defaultHeight, string $iconBaseUrl = ''): self

Returns a copy with drawer presentation settings.

Parameters

ParameterTypeDescription
$positionstring
$defaultHeightint
$iconBaseUrlstring

Returns

self