EntryParser
API reference › Debug Core › Registration › EntryParser
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.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
assertKeyMatchesId() static | Rejects a string registration key that differs from the ID the registered object declares. | EntryParser |
enabled() static | Returns the effective enabled flag of an entry. | EntryParser |
parse() static | Splits one entry into the class to resolve and the options declared beside it. | EntryParser |
Method details
Section titled “Method details”assertKeyMatchesId()
Section titled “assertKeyMatchesId() ”public static function assertKeyMatchesId(int|string $key, string $id, string $kind): voidRejects 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
| Parameter | Type | Description |
|---|---|---|
$key | int| | Key the configuration registers the entry under. |
$id | string | ID the registered collector or panel declares. |
$kind | string | Entry kind named in the failure, such as 'collector' or 'panel'. |
Throws
InvalidArgumentException: when a string key differs from the declared ID.
enabled()
Section titled “enabled() ”public static function enabled(array<array-key, mixed> $options, string $id): boolReturns the effective enabled flag of an entry.
A null value counts as absent, as it does for PanelOverride::fromArray().
Parameters
| Parameter | Type | Description |
|---|---|---|
$options | array<array-key, | Entry options, or a whole configuration array declaring enabled. |
$id | string | Configuration ID naming the entry in a failure. |
Returns
bool: Declared flag, or true when the entry omits it.
Throws
InvalidArgumentException: whenenabledis neither aboolnornull.
parse()
Section titled “parse() ”public static function parse(mixed $entry, string $id): PHPForge\Debug\Registration\ParsedEntrySplits 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
| Parameter | Type | Description |
|---|---|---|
$entry | mixed | Class string, or an array declaring a class string plus options. |
$id | string | Configuration ID naming the entry in a failure. |
Returns
ParsedEntry: Class and remaining options, enabled included.
Throws
InvalidArgumentException: when the entry declares no class string.