# HandlerDefinitionNormalizer

> Converts Yii router middleware definitions into safe, stable scalar labels.

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

| final class | `Yii3\Debug\Routing\HandlerDefinitionNormalizer` |
| --- | --- |
| Source | [`src/Routing/HandlerDefinitionNormalizer.php`](https://github.com/yii3/debug/blob/main/src/Routing/HandlerDefinitionNormalizer.php#L16) |

Converts Yii router middleware definitions into safe, stable scalar labels.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`describe()`](#method-describe) static | Formats an action or middleware definition without retaining its object graph or configuration values. | `HandlerDefinitionNormalizer` |
| [`describeAll()`](#method-describeAll) static | Formats every handler definition, dropping the ones that carry no recognizable name. | `HandlerDefinitionNormalizer` |

## Method details

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

```php
public static function describe(mixed $definition): string|null
```

Formats an action or middleware definition without retaining its object graph or configuration values.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$definition` | `mixed` | Handler as a class name, a `['class' => ...]` array, a callable pair, or any other value. |

**Returns**

`string|null`: Scalar label, or `null` when the definition carries no recognizable name.

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

```php
public static function describeAll(array<array-key, mixed> $definitions): list<string>
```

Formats every handler definition, dropping the ones that carry no recognizable name.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$definitions` | `array<array-key, mixed>` | Handler definitions in declaration order. |

**Returns**

`list<string>`: Scalar labels in the same order, unnamed handlers omitted.