TimelineSpanRow
API reference › Debug Core › Panel › Timeline › TimelineSpanRow
Typed view-model for one span row in the Timeline panel chart.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$category readonly constructor | string | Span category (Command::query(), Application::handleRequest(), …), or '' when not captured. | TimelineSpanRow |
$cssLeft readonly constructor | string | Bar left offset on the chart, as a percentage string (for example, 12.5) consumed by inline style="left:<X>%". | TimelineSpanRow |
$cssWidth readonly constructor | string | Bar width on the chart, as a percentage string with a 0.4% floor so single-millisecond spans stay visible. | TimelineSpanRow |
$depth readonly constructor | int | Nesting depth in the call tree; the renderer indents the row by this multiplier. | TimelineSpanRow |
$duration readonly constructor | float | Span duration in milliseconds. | TimelineSpanRow |
$tooltip readonly constructor | string | Pre-formatted <title> tooltip text combining category/info, duration, peak memory, and memory delta. | TimelineSpanRow |
$variant readonly constructor | string | CSS variant token (app / db / view / cache / mail / queue / other) derived from $category. | TimelineSpanRow |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a span row for the Timeline chart. | TimelineSpanRow |
from() static | Builds the view row from a captured profile block and its computed chart geometry. | TimelineSpanRow |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $category, float $duration, int $depth, string $cssLeft, string $cssWidth, string $variant, string $tooltip)Creates a span row for the Timeline chart.
Parameters
| Parameter | Type | Description |
|---|---|---|
$category | string | |
$duration | float | |
$depth | int | |
$cssLeft | string | |
$cssWidth | string | |
$variant | string | |
$tooltip | string |
from()
Section titled “from() ”public static function from(PHPForge\Debug\Panel\Profile\ProfileRow $row, float $left, float $width): selfBuilds the view row from a captured profile block and its computed chart geometry.
Derives the CSS variant and the tooltip text, and clamps the bar width to the visible floor (0.4%).
The indent reuses the nesting level the profiler already recorded, so the chart and the Profiling grid agree on the call tree.
Parameters
| Parameter | Type | Description |
|---|---|---|
$row | PHPForge\ | Captured profile block. |
$left | float | Bar left offset as a percentage of the request duration. |
$width | float | Bar width as a percentage of the request duration. |
Returns
self