# EventRow

> Typed event row recorded by the wildcard listener and persisted in that form.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Event](/docs/extensions/debug-core/reference/panel/event/index.md) › EventRow

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

Typed event row recorded by the wildcard listener and persisted in that form.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-class"></span>`$class` readonly constructor | `string` | Fully qualified class name of the event object. | `EventRow` |
| [`$isStatic`](#property-isStatic) readonly constructor | `string` | `'1'` when the event was triggered statically (no sender), `'0'` otherwise. | `EventRow` |
| <span id="property-name"></span>`$name` readonly constructor | `string` | Event name (for example, `EVENT_AFTER_REQUEST`). | `EventRow` |
| <span id="property-senderClass"></span>`$senderClass` readonly constructor | `string` | Fully qualified class name of the sender, or `''` when the event was triggered statically. | `EventRow` |
| <span id="property-time"></span>`$time` readonly constructor | `float` | Capture timestamp in seconds since the Unix epoch. | `EventRow` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates an event row from captured listener data. | `EventRow` |
| [`distinctClassCount()`](#method-distinctClassCount) static | Returns how many distinct event classes the given rows cover. | `EventRow` |
| [`fromArray()`](#method-fromArray) static | Hydrates an event row from decoded JSON data. | `EventRow` |
| [`inspection()`](#method-inspection) | Returns the optional diagnostics attached to the row. | `EventRow` |
| [`jsonSerialize()`](#method-jsonSerialize) | Returns the row for JSON serialization. | `EventRow` |
| [`staticCount()`](#method-staticCount) static | Returns how many of the given rows were triggered statically. | `EventRow` |
| [`withInspection()`](#method-withInspection) | Returns an enriched copy without changing the constructor or the original captured row. | `EventRow` |

## Property details

### $isStatic <span id="property-isStatic"></span>

```php
public readonly string $isStatic
```

`'1'` when the event was triggered statically (no sender), `'0'` otherwise.

Stored as a string so the value round-trips through the search model's `boolean` rule.

## Method details

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

```php
public function __construct(float $time, string $name, string $class, string $isStatic, string $senderClass)
```

Creates an event row from captured listener data.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$time` | `float` |  |
| `$name` | `string` |  |
| `$class` | `string` |  |
| `$isStatic` | `string` |  |
| `$senderClass` | `string` |  |

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

```php
public static function distinctClassCount(list<self> $rows): int
```

Returns how many distinct event classes the given rows cover.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rows` | `list<self>` | Captured event rows. |

**Returns**

`int`: Number of distinct event classes across the given rows.

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

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

Hydrates an event row from decoded JSON data.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `mixed` | Decoded event row payload. |
| `$path` | `string` | Payload path used in hydration errors. |

**Returns**

`self`: Hydrated row, enriched with diagnostics when the payload carried them.

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

```php
public function inspection(): PHPForge\Debug\Panel\Event\EventInspection|null
```

Returns the optional diagnostics attached to the row.

**Returns**

[`EventInspection`](/docs/extensions/debug-core/reference/panel/event/eventinspection/index.md)`|null`: Attached diagnostics, or `null` when the row was captured without them.

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

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

Returns the row for JSON serialization.

**Returns**

`array<string, mixed>`: Serialized row fields, including the diagnostics when the row carries them.

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

```php
public static function staticCount(list<self> $rows): int
```

Returns how many of the given rows were triggered statically.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rows` | `list<self>` | Captured event rows. |

**Returns**

`int`: Number of statically triggered rows.

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

```php
public function withInspection(PHPForge\Debug\Panel\Event\EventInspection $inspection): self
```

Returns an enriched copy without changing the constructor or the original captured row.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$inspection` | [`EventInspection`](/docs/extensions/debug-core/reference/panel/event/eventinspection/index.md) | Optional diagnostics to attach. |

**Returns**

`self`: Row carrying the diagnostics.