Skip to content
PHP Ecosystem
Explore

PanelOverride

API reference › Debug Core › Registration › PanelOverride

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

Represents the panel metadata an application overrides in its debug configuration.

Every property stays null when the corresponding key is absent, so the provider default wins.

PropertyTypeDescriptionDefined by
$enabled readonly constructorbool|nullfalse to remove the panel from the host, or null to keep it registered. Default: null.PanelOverride
$icon readonly constructorstring|nullIcon key replacing the provider default, or null to keep it. Default: null.PanelOverride
$position readonly constructorint|nullSort weight among extensions, or null to order the entry by title. Default: null.PanelOverride
$title readonly constructorstring|nullDisplay title replacing the provider default, or null to keep it. Default: null.PanelOverride
MethodDescriptionDefined by
__construct()Creates panel metadata overrides from the supplied values.PanelOverride
fromArray() staticCreates an override from one panel entry of the application configuration.PanelOverride
ConstantValueDescriptionDefined by
KEYS['enabled', 'icon', 'position', 'title']Configuration keys accepted by a panel entry, in alphabetical order.PanelOverride
public function __construct(string|null $title = null, string|null $icon = null, bool|null $enabled = null, int|null $position = null)

Creates panel metadata overrides from the supplied values.

Parameters

ParameterTypeDescription
$titlestring|nullDisplay title replacing the provider default, or null to keep it.
$iconstring|nullIcon key replacing the provider default, or null to keep it.
$enabledbool|nullfalse to remove the panel from the host, or null to keep it registered.
$positionint|nullSort weight among extensions, or null to order the entry by title.
public static function fromArray(array<array-key, mixed> $config): self

Creates an override from one panel entry of the application configuration.

Rejects unknown keys and wrong value types by key name. An empty array yields an override that changes nothing.

Parameters

ParameterTypeDescription
$configarray<array-key, mixed>Panel entry keyed by PanelOverride::KEYS.

Returns

self: Override carrying the configured values.

Throws