# CurrentRouteLogRow

> Typed row of the Current Route rules-tested log, resolved once from the URL-manager trace.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Router](/docs/extensions/debug-core/reference/panel/router/index.md) › CurrentRouteLogRow

| final readonly class | `PHPForge\Debug\Panel\Router\CurrentRouteLogRow` |
| --- | --- |
| Implements | [`PHPForge\Debug\Storage\PanelRow`](/docs/extensions/debug-core/reference/storage/panelrow/index.md) |
| Source | [`src/Panel/Router/CurrentRouteLogRow.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Router/CurrentRouteLogRow.php#L17) |

Typed row of the Current Route rules-tested log, resolved once from the URL-manager trace.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-match"></span>`$match` readonly constructor | `bool` | `true` when this rule produced the final match; the renderer surfaces the row with a success modifier. | `CurrentRouteLogRow` |
| <span id="property-parent"></span>`$parent` readonly constructor | `string` | Parent rule ([`UrlRule`](/docs/api/yii/rest/urlrule/index.md) for nested REST rules), or `''` when there is no parent. | `CurrentRouteLogRow` |
| <span id="property-rule"></span>`$rule` readonly constructor | `string` | Rule name or its class FQCN as captured by the route resolver. | `CurrentRouteLogRow` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates a row from the current-route rules-tested log. | `CurrentRouteLogRow` |
| [`fromArray()`](#method-fromArray) static | Narrows one persisted rule of the routing payload into a typed row. | `CurrentRouteLogRow` |
| [`fromLogMessage()`](#method-fromLogMessage) static | Narrows one raw URL-manager trace payload, returning `null` when it does not carry a rule/match pair. | `CurrentRouteLogRow` |
| [`jsonSerialize()`](#method-jsonSerialize) | Returns the typed row for JSON serialization. | `CurrentRouteLogRow` |

## Method details

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

```php
public function __construct(string $rule, string $parent, bool $match)
```

Creates a row from the current-route rules-tested log.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rule` | `string` |  |
| `$parent` | `string` |  |
| `$match` | `bool` |  |

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

```php
public static function fromArray(mixed $data, string $path): self
```

Narrows one persisted rule of the routing payload into a typed row.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `mixed` | Persisted rule, expected to be an object carrying the declared shape. |
| `$path` | `string` | JSON path of the rule, used to report a malformed payload. |

**Returns**

`self`: Row carrying the inspected rule, its parent, and the match flag.

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

```php
public static function fromLogMessage(mixed $message): self|null
```

Narrows one raw URL-manager trace payload, returning `null` when it does not carry a rule/match pair.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$message` | `mixed` | Raw logger payload. |

**Returns**

`self|null`

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

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

Returns the typed row for JSON serialization.

**Returns**

`array<string, mixed>`