# ThemeResolver

> Resolves the effective debugger theme from the request's cookie and query parameters.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Theme](/docs/extensions/debug-core/reference/theme/index.md) › ThemeResolver

| final class | `PHPForge\Debug\Theme\ThemeResolver` |
| --- | --- |
| Source | [`src/Theme/ThemeResolver.php`](https://github.com/php-forge/debug-core/blob/main/src/Theme/ThemeResolver.php#L13) |

Resolves the effective debugger theme from the request's cookie and query parameters.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`resolve()`](#method-resolve) static | Returns the effective theme (`'light'` or `'dark'`). | `ThemeResolver` |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-COOKIE"></span>`COOKIE` | `'yii-debug-toolbar-theme'` | Cookie written by the client-side theme toggle. | `ThemeResolver` |
| <span id="const-QUERY_PARAM"></span>`QUERY_PARAM` | `'yii_debug_theme'` | Query parameter carrying the link-time theme snapshot. | `ThemeResolver` |

## Method details

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

```php
public static function resolve(array<array-key, mixed> $cookieParams, array<array-key, mixed> $queryParams): string
```

Returns the effective theme (`'light'` or `'dark'`).

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$cookieParams` | `array<array-key, mixed>` | Request cookies. |
| `$queryParams` | `array<array-key, mixed>` | Parsed query parameters. |

**Returns**

`string`