# RouterRuleRow

> Typed view-model for one row in the Router Rules table.

[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) › RouterRuleRow

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

Typed view-model for one row in the Router Rules table.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-mode"></span>`$mode` readonly constructor | `string` | Routing mode (`PARSING ONLY` / `CREATION ONLY` / `BOTH`), or `''` when the rule did not surface a mode. | `RouterRuleRow` |
| <span id="property-name"></span>`$name` readonly constructor | `string` | Rule name or its class FQCN. | `RouterRuleRow` |
| <span id="property-route"></span>`$route` readonly constructor | `string` | Route target the rule maps to (for example, `site/index` or `<controller>/<action>`). | `RouterRuleRow` |
| <span id="property-suffix"></span>`$suffix` readonly constructor | `string` | URL suffix declared on the rule (for example, `.html`), or `''` when the rule inherits the global suffix. | `RouterRuleRow` |
| <span id="property-type"></span>`$type` readonly constructor | `string` | Rule type, typically the FQCN of the matching rule class. | `RouterRuleRow` |
| <span id="property-verb"></span>`$verb` readonly constructor | `string` | Comma-separated verb list (for example, `GET, POST`), or `''` when the rule does not restrict verbs. | `RouterRuleRow` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates a Router Rules table row. | `RouterRuleRow` |
| [`from()`](#method-from) static | Narrows the loose array shape captured by the Router Rules model into a typed row. | `RouterRuleRow` |

## Method details

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

```php
public function __construct(string $name, string $route, string $verb, string $suffix, string $mode, string $type)
```

Creates a Router Rules table row.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `string` |  |
| `$route` | `string` |  |
| `$verb` | `string` |  |
| `$suffix` | `string` |  |
| `$mode` | `string` |  |
| `$type` | `string` |  |

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

```php
public static function from(array<string, mixed> $row): self
```

Narrows the loose array shape captured by the Router Rules model into a typed row.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | `array<string, mixed>` | Source row. |

**Returns**

`self`