Skip to content
PHP Ecosystem
Explore

EntryParser

API reference › Debug Core › Registration › EntryParser

final classPHPForge\Debug\Registration\EntryParser
Sourcesrc/Registration/EntryParser.php

Reads the collector and panel entries an application declares in its debug configuration.

The three checks are separate calls, so each host keeps its own validation order and wraps every InvalidArgumentException in the message its users already know.

MethodDescriptionDefined by
assertKeyMatchesId() staticRejects a string registration key that differs from the ID the registered object declares.EntryParser
enabled() staticReturns the effective enabled flag of an entry.EntryParser
parse() staticSplits one entry into the class to resolve and the options declared beside it.EntryParser
public static function assertKeyMatchesId(int|string $key, string $id, string $kind): void

Rejects a string registration key that differs from the ID the registered object declares.

An integer key comes from a list entry, which names no ID and is accepted as is.

Parameters

ParameterTypeDescription
$keyint|stringKey the configuration registers the entry under.
$idstringID the registered collector or panel declares.
$kindstringEntry kind named in the failure, such as 'collector' or 'panel'.

Throws

public static function enabled(array<array-key, mixed> $options, string $id): bool

Returns the effective enabled flag of an entry.

A null value counts as absent, as it does for PanelOverride::fromArray().

Parameters

ParameterTypeDescription
$optionsarray<array-key, mixed>Entry options, or a whole configuration array declaring enabled.
$idstringConfiguration ID naming the entry in a failure.

Returns

bool: Declared flag, or true when the entry omits it.

Throws

public static function parse(mixed $entry, string $id): PHPForge\Debug\Registration\ParsedEntry

Splits one entry into the class to resolve and the options declared beside it.

The class is not checked for existence, so a disabled entry naming an uninstalled optional package never reaches the autoloader.

Parameters

ParameterTypeDescription
$entrymixedClass string, or an array declaring a class string plus options.
$idstringConfiguration ID naming the entry in a failure.

Returns

ParsedEntry: Class and remaining options, enabled included.

Throws