PanelRegistration
API reference › Debug Core › Registration › PanelRegistration
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.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$extension readonly constructor | bool | true when the host groups the panel under its Extensions menu; false for a built-in. | PanelRegistration |
$icon readonly constructor | string | Icon key, or '' when the panel has no icon. | PanelRegistration |
$id readonly constructor | string | Stable panel identifier, never normalized. | PanelRegistration |
$position readonly constructor | int| | Sort weight among extensions, or null to order the entry by title. Default: null. | PanelRegistration |
$title readonly constructor | string | Display title. | PanelRegistration |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Validates the registration metadata and rejects an ID that is empty or padded with whitespace. | PanelRegistration |
builtIn() static | Creates a registration for a host built-in panel, which keeps its fixed display order. | PanelRegistration |
extension() static | Creates 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 |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”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
| Parameter | Type | Description |
|---|---|---|
$id | string | Stable panel identifier, never normalized. |
$title | string | Display title. |
$icon | string | Icon key, or '' when the panel has no icon. |
$extension | bool | true when the host groups the panel under its Extensions menu; false for a built-in. |
$position | int| | Sort weight among extensions, or null to order the entry by title. |
Throws
InvalidArgumentException: When the ID, the title, or the icon key is invalid.
builtIn()
Section titled “builtIn() ”public static function builtIn(string $id, string $title, string $icon): selfCreates a registration for a host built-in panel, which keeps its fixed display order.
Parameters
| Parameter | Type | Description |
|---|---|---|
$id | string | Stable panel identifier. |
$title | string | Provider default title. |
$icon | string | Provider default icon key, or '' when the panel has no icon. |
Returns
self: Built-in registration.
Throws
InvalidArgumentException: When the ID, the title, or the icon key is invalid.
extension()
Section titled “extension() ”public static function extension(string $id, string $title, string $icon): selfCreates a registration for a provider-owned panel, which the host groups under its Extensions menu.
Parameters
| Parameter | Type | Description |
|---|---|---|
$id | string | Stable panel identifier. |
$title | string | Provider default title. |
$icon | string | Provider default icon key, or '' when the panel has no icon. |
Returns
self: Extension registration.
Throws
InvalidArgumentException: When the ID, the title, or the icon key is invalid.
withOverride()
Section titled “withOverride() ”public function withOverride(PHPForge\Debug\Registration\PanelOverride $override): selfReturns a copy with the configured title, icon, and position applied.
Values the override leaves null keep the provider default.
Parameters
| Parameter | Type | Description |
|---|---|---|
$override | PanelOverride | Application configuration for this panel. |
Returns
self: Registration carrying the effective metadata.
Throws
InvalidArgumentException: When the override sets a position on a built-in panel.