# UserDataNormalizer

> Narrows the captured identity payload into the typed PHPForge\Debug\Panel\User\UserIdentityView.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [User](/docs/extensions/debug-core/reference/panel/user/index.md) › UserDataNormalizer

| final class | `PHPForge\Debug\Panel\User\UserDataNormalizer` |
| --- | --- |
| Source | [`src/Panel/User/UserDataNormalizer.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/User/UserDataNormalizer.php#L26) |

Narrows the captured identity payload into the typed [`UserIdentityView`](/docs/extensions/debug-core/reference/panel/user/useridentityview/index.md).

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`fromIdentity()`](#method-fromIdentity) static | Builds the typed identity view-model from the raw attribute map and the optional label map. | `UserDataNormalizer` |

## Method details

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

```php
public static function fromIdentity(array<string, string> $identity, array<int, array{attribute: string, label: string}>|null $attributes): PHPForge\Debug\Panel\User\UserIdentityView
```

Builds the typed identity view-model from the raw attribute map and the optional label map.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$identity` | `array<string, string>` | Raw identity attribute map. |
| `$attributes` | `array<int, array{attribute: string, label: string}>\|null` | Optional label map from the user panel, or `null` when no labels were supplied. |

**Returns**

[`UserIdentityView`](/docs/extensions/debug-core/reference/panel/user/useridentityview/index.md)