Skip to content
PHP Ecosystem
Explore

CoreDefinitions

API reference › Debug › service › CoreDefinitions

final classyii\debug\service\CoreDefinitions
Sourcesrc/service/CoreDefinitions.php

Merges the built-in collector and panel definitions with the ones the application declares.

MethodDescriptionDefined by
isAvailable() staticReturns whether the optional package a built-in depends on is installed.CoreDefinitions
merge() staticDrops the built-ins whose optional package is unavailable, then appends the configured entries.CoreDefinitions
public static function isAvailable(string $id): bool

Returns whether the optional package a built-in depends on is installed.

Parameters

ParameterTypeDescription
$idstringStable 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.

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

ParameterTypeDescription
$corearray<string, yii\debug\service\TDefinition>Built-in definitions indexed by stable ID.
$configuredarray<array-key, yii\debug\service\TDefinition>Definitions declared by the application.

Returns

array<array-key, yii\debug\service\TDefinition>: Available built-ins not overridden by configuration, then the configured entries.