Skip to content
PHP Ecosystem
Explore

PanelRegistration

API reference › Debug Core › Registration › PanelRegistration

final readonly classPHPForge\Debug\Registration\PanelRegistration
Sourcesrc/Registration/PanelRegistration.php

Represents the host registration metadata of one debug panel.

The ID is the stable association with captured data, so renaming a panel through PanelRegistration::withOverride() never changes the stored key or any URL.

PropertyTypeDescriptionDefined by
$extension readonly constructorbooltrue when the host groups the panel under its Extensions menu; false for a built-in.PanelRegistration
$icon readonly constructorstringIcon key, or '' when the panel has no icon.PanelRegistration
$id readonly constructorstringStable panel identifier, never normalized.PanelRegistration
$position readonly constructorint|nullSort weight among extensions, or null to order the entry by title. Default: null.PanelRegistration
$title readonly constructorstringDisplay title.PanelRegistration
MethodDescriptionDefined by
__construct()Validates the registration metadata and rejects an ID that is empty or padded with whitespace.PanelRegistration
builtIn() staticCreates a registration for a host built-in panel, which keeps its fixed display order.PanelRegistration
extension() staticCreates a registration for a provider-owned panel, which the host groups under its Extensions menu.PanelRegistration
withOverride()Returns a copy with the configured title, icon, and position applied.PanelRegistration
public function __construct(string $id, string $title, string $icon, bool $extension, int|null $position = null)

Validates the registration metadata and rejects an ID that is empty or padded with whitespace.

Parameters

ParameterTypeDescription
$idstringStable panel identifier, never normalized.
$titlestringDisplay title.
$iconstringIcon key, or '' when the panel has no icon.
$extensionbooltrue when the host groups the panel under its Extensions menu; false for a built-in.
$positionint|nullSort weight among extensions, or null to order the entry by title.

Throws

public static function builtIn(string $id, string $title, string $icon): self

Creates a registration for a host built-in panel, which keeps its fixed display order.

Parameters

ParameterTypeDescription
$idstringStable panel identifier.
$titlestringProvider default title.
$iconstringProvider default icon key, or '' when the panel has no icon.

Returns

self: Built-in registration.

Throws

public static function extension(string $id, string $title, string $icon): self

Creates a registration for a provider-owned panel, which the host groups under its Extensions menu.

Parameters

ParameterTypeDescription
$idstringStable panel identifier.
$titlestringProvider default title.
$iconstringProvider default icon key, or '' when the panel has no icon.

Returns

self: Extension registration.

Throws

public function withOverride(PHPForge\Debug\Registration\PanelOverride $override): self

Returns a copy with the configured title, icon, and position applied.

Values the override leaves null keep the provider default.

Parameters

ParameterTypeDescription
$overridePanelOverrideApplication configuration for this panel.

Returns

self: Registration carrying the effective metadata.

Throws