Skip to content
PHP Ecosystem
Explore

PanelRegistry

API reference › Debug Core › Registration › PanelRegistry

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

Resolves provider defaults against the application configuration into one effective panel catalog.

Built-ins keep their registration order and every extension follows, ordered by position ascending, then by effective title case-insensitively, then by ID.

MethodDescriptionDefined by
disabled()Returns the disabled panel IDs, including entries with no default.PanelRegistry
enabled()Returns the effective panel registrations in display order.PanelRegistry
get()Returns the effective registration of a panel.PanelRegistry
isDisabled()Returns whether the configuration removed a panel.PanelRegistry
resolve() staticMerges provider defaults with the application configuration and computes the display order.PanelRegistry
public function disabled(): list<string>

Returns the disabled panel IDs, including entries with no default.

Returns

list<string>: IDs removed by configuration, sorted alphabetically.

public function enabled(): list<PHPForge\Debug\Registration\PanelRegistration>

Returns the effective panel registrations in display order.

Returns

list<PanelRegistration>: Effective registrations in display order.

public function get(string $id): PHPForge\Debug\Registration\PanelRegistration|null

Returns the effective registration of a panel.

Parameters

ParameterTypeDescription
$idstringStable panel identifier.

Returns

PanelRegistration|null: Effective registration, or null when the ID is unknown or disabled.

public function isDisabled(string $id): bool

Returns whether the configuration removed a panel.

Parameters

ParameterTypeDescription
$idstringStable panel identifier.

Returns

bool: Whether the ID is disabled.

public static function resolve(iterable<PHPForge\Debug\Registration\PanelRegistration> $defaults, iterable<string, PHPForge\Debug\Registration\PanelOverride> $overrides = []): self

Merges provider defaults with the application configuration and computes the display order.

An override targeting an ID with no default is accepted only when it disables the entry, which covers an optional package that is not installed; any other override for an unknown ID is a typo and is rejected.

Parameters

ParameterTypeDescription
$defaultsiterable<PanelRegistration>Host built-ins first, then providers, with provider defaults.
$overridesiterable<string, PanelOverride>Application configuration indexed by panel ID.

Returns

self: Resolved catalog.

Throws

  • InvalidArgumentException: When a default ID is registered twice, an override targets an unknown ID without disabling it, or an override sets a position on a built-in panel.