CoreDefinitions
API reference › Debug › service › CoreDefinitions
Merges the built-in collector and panel definitions with the ones the application declares.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
isAvailable() static | Returns whether the optional package a built-in depends on is installed. | CoreDefinitions |
merge() static | Drops the built-ins whose optional package is unavailable, then appends the configured entries. | CoreDefinitions |
Method details
Section titled “Method details”isAvailable()
Section titled “isAvailable() ”public static function isAvailable(string $id): boolReturns whether the optional package a built-in depends on is installed.
Parameters
| Parameter | Type | Description |
|---|---|---|
$id | string | Stable ID of a built-in collector or panel. |
Returns
bool: true when the package is installed, or when the ID depends on none; false otherwise.
merge()
Section titled “merge() ”public static function merge(array<string, yii\debug\service\TDefinition> $core, array<array-key, yii\debug\service\TDefinition> $configured): array<array-key, yii\debug\service\TDefinition>Drops the built-ins whose optional package is unavailable, then appends the configured entries.
A built-in the configuration redeclares under the same ID moves to the configured position, so the application decides both the implementation and the display order of that entry.
Parameters
| Parameter | Type | Description |
|---|---|---|
$core | array<string, | Built-in definitions indexed by stable ID. |
$configured | array<array-key, | Definitions declared by the application. |
Returns
array<array-key, yii\debug\service\TDefinition>: Available built-ins not overridden by configuration, then the configured entries.