# UserPanel

> Adapts the framework-neutral PHPForge User panel to the Yii3 debugger.

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

| final class | `Yii3\Debug\Panel\UserPanel` |
| --- | --- |
| Extends | [`ProviderPanel`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md) |
| Implements | [`ToolbarPanelProviderInterface`](/docs/extensions/yii3-debug/reference/panel/toolbarpanelproviderinterface/index.md) |
| Source | [`src/Panel/UserPanel.php`](https://github.com/yii3/debug/blob/main/src/Panel/UserPanel.php#L19) |

Adapts the framework-neutral PHPForge User panel to the Yii3 debugger.

The detail view and the sidebar entry come from the shared presentation, which shows its empty state for a guest
capture. The toolbar metric matches the Yii2 User panel instead of the shared username metric: it names the user
ID, or reads `Guest` when nobody was signed in.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Binds the adapter to the shared User presentation. | `UserPanel` |
| <span id="method-hasContent"></span>[`hasContent()`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md#method-hasContent) | Returns whether the capture holds a presentation for this panel. | [`ProviderPanel`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md) |
| <span id="method-icon"></span>[`icon()`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md#method-icon) | Returns the shared Debug Core icon key. | [`ProviderPanel`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md) |
| <span id="method-id"></span>[`id()`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md#method-id) | Returns the stable identifier of this panel. | [`ProviderPanel`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md) |
| <span id="method-name"></span>[`name()`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md#method-name) | Returns the human-readable panel name. | [`ProviderPanel`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md) |
| <span id="method-render"></span>[`render()`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md#method-render) | Renders the detail content the provider produces for a capture. | [`ProviderPanel`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md) |
| [`toolbarItems()`](#method-toolbarItems) | Names the signed-in user by ID, or reports a guest. | `UserPanel` |
| <span id="method-withMetadata"></span>[`withMetadata()`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md#method-withMetadata) | Returns a copy presenting the panel under the metadata the application configured. | [`ProviderPanel`](/docs/extensions/yii3-debug/reference/panel/providerpanel/index.md) |

## Method details

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

```php
public function __construct()
```

Binds the adapter to the shared User presentation.

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

```php
public function toolbarItems(array<string, mixed> $payload): list<PHPForge\Debug\Toolbar\ToolbarItem>
```

Names the signed-in user by ID, or reports a guest.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$payload` | `array<string, mixed>` | Serialized panel payload. |

**Returns**

`list<PHPForge\Debug\Toolbar\ToolbarItem>`: One `info` metric carrying the user ID, or a `Guest` metric when the capture holds no ID.

**Throws**

- `PHPForge\Debug\Storage\HydrationException`: when the payload does not match the User snapshot schema.