# CoreDefinitions

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

[API reference](/docs/api/index.md) › [Debug](/docs/extensions/debug/reference/index.md) › [service](/docs/extensions/debug/reference/service/index.md) › CoreDefinitions

| final class | `yii\debug\service\CoreDefinitions` |
| --- | --- |
| Source | [`src/service/CoreDefinitions.php`](https://github.com/yii2-extensions/debug/blob/main/src/service/CoreDefinitions.php#L12) |

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

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`isAvailable()`](#method-isAvailable) static | Returns whether the optional package a built-in depends on is installed. | `CoreDefinitions` |
| [`merge()`](#method-merge) static | Drops the built-ins whose optional package is unavailable, then appends the configured entries. | `CoreDefinitions` |

## Method details

### isAvailable() <span id="method-isAvailable"></span>

```php
public static function isAvailable(string $id): bool
```

Returns 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() <span id="method-merge"></span>

```php
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, yii\debug\service\TDefinition>` | Built-in definitions indexed by stable ID. |
| `$configured` | `array<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.