# DebugServiceProvider

> Attaches the debugger to the application PSR-14 dispatcher and asset loader without redefining either service.

[API reference](/docs/api/index.md) › [Yii3 Debug](/docs/extensions/yii3-debug/reference/index.md) › DebugServiceProvider

| final class | `Yii3\Debug\DebugServiceProvider` |
| --- | --- |
| Implements | `Yiisoft\Di\ServiceProviderInterface` |
| Source | [`src/DebugServiceProvider.php`](https://github.com/yii3/debug/blob/main/src/DebugServiceProvider.php#L26) |

Attaches the debugger to the application PSR-14 dispatcher and asset loader without redefining either service.

Every decoration is idempotent, so an application registering the provider in more than one configuration group still
ends up with each service decorated exactly once.

The Logs panel is fed by the `debug` target the package merges into the `yiisoft/log` parameters, so the application
logger is built by the application itself and is never decorated here.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`getDefinitions()`](#method-getDefinitions) | Returns the services the provider owns. | `DebugServiceProvider` |
| [`getExtensions()`](#method-getExtensions) | Returns the decorations applied to the application PSR-14 dispatcher and asset loader. | `DebugServiceProvider` |

## Method details

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

```php
public function getDefinitions(): array<string, mixed>
```

Returns the services the provider owns.

**Returns**

`array<string, mixed>`: Empty set; the debugger only extends services the application already declares.

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

```php
public function getExtensions(): array<class-string, Closure(Psr\Container\ContainerInterface, object): object>
```

Returns the decorations applied to the application PSR-14 dispatcher and asset loader.

Each service keeps its application definition; a decoration runs once, when the container first resolves it.

**Returns**

`array<class-string,` [`Closure`](https://www.php.net/manual/en/class.closure.php)`(Psr\Container\ContainerInterface, object): object>`: Decorations keyed by extended service.