Skip to content
PHP Ecosystem
Explore

HistoryMetricComparison

API reference › Yii3 Debug › Comparison › HistoryMetricComparison

final readonly classYii3\Debug\Comparison\HistoryMetricComparison
Sourcesrc/Comparison/HistoryMetricComparison.php

Immutable presentation data for one request-summary metric in a capture comparison.

PropertyTypeDescriptionDefined by
$label readonly constructorstringHuman-readable metric name.HistoryMetricComparison
MethodDescriptionDefined by
baseline()Returns the formatted value of the baseline capture.HistoryMetricComparison
create() staticCreates a metric that can be fluently linked with withPanelId().HistoryMetricComparison
delta()Returns the formatted difference between both captures.HistoryMetricComparison
panelId()Returns the panel this metric deep-links to.HistoryMetricComparison
target()Returns the formatted value of the target capture.HistoryMetricComparison
trend()Returns the direction the metric moved in.HistoryMetricComparison
withPanelId()Returns a copy deep-linking the metric to a panel.HistoryMetricComparison
public function baseline(): string

Returns the formatted value of the baseline capture.

Returns

string: Formatted baseline value.

public static function create(string $label, Yii3\Debug\Comparison\HistoryMetricValues $values): self

Creates a metric that can be fluently linked with withPanelId().

Parameters

ParameterTypeDescription
$labelstringHuman-readable metric name.
$valuesHistoryMetricValuesFormatted values and outcome of the metric.

Returns

self: Metric without a panel link.

public function delta(): string

Returns the formatted difference between both captures.

Returns

string: Formatted difference from baseline to target.

public function panelId(): string|null

Returns the panel this metric deep-links to.

Returns

string|null: Panel the metric deep-links to, or null when it links nowhere.

public function target(): string

Returns the formatted value of the target capture.

Returns

string: Formatted target value.

public function trend(): string

Returns the direction the metric moved in.

Returns

string: Directional CSS vocabulary: 'up', 'down', or 'neutral'.

public function withPanelId(string|null $panelId): self

Returns a copy deep-linking the metric to a panel.

Parameters

ParameterTypeDescription
$panelIdstring|nullPanel to link to, or null to drop the link.

Returns

self: Metric with the link applied.