Skip to content
PHP Ecosystem
Explore

SummaryMetricComparison

API reference › Debug Core › Comparison › SummaryMetricComparison

final readonly classPHPForge\Debug\Comparison\SummaryMetricComparison
Sourcesrc/Comparison/SummaryMetricComparison.php

Calculates and formats request-summary metrics without depending on adapter presentation models.

Results retain the history labels, order, units, trends, and related panel IDs used by both adapters.

PropertyTypeDescriptionDefined by
$baseline readonly constructorstringFormatted baseline value.SummaryMetricComparison
$delta readonly constructorstringFormatted difference, or No change when both values match.SummaryMetricComparison
$label readonly constructorstringHistory metric label.SummaryMetricComparison
$panelId readonly constructorstring|nullRelated panel ID, or null when the metric has no panel. Default: null.SummaryMetricComparison
$target readonly constructorstringFormatted target value.SummaryMetricComparison
$trend readonly constructorstringTrend direction: up, down, or neutral.SummaryMetricComparison
MethodDescriptionDefined by
between() staticCompares summaries in the canonical history metric order.SummaryMetricComparison
hasDifference()Returns whether the metric changed between the baseline and the target.SummaryMetricComparison
public static function between(PHPForge\Debug\Storage\RequestSummary $baseline, PHPForge\Debug\Storage\RequestSummary $target): list<self>

Compares summaries in the canonical history metric order.

Parameters

ParameterTypeDescription
$baselinePHPForge\Debug\Storage\RequestSummaryBaseline request metadata.
$targetPHPForge\Debug\Storage\RequestSummaryTarget request metadata.

Returns

list<self>: Metric comparisons in canonical history order.

public function hasDifference(): bool

Returns whether the metric changed between the baseline and the target.

Returns

bool: true when the formatted delta reports a change; false otherwise.