Skip to content
PHP Ecosystem
Explore

HistoryComparison

API reference › Debug › widgets › history › HistoryComparison

final readonly classyii\debug\widgets\history\HistoryComparison
Sourcesrc/widgets/history/HistoryComparison.php

Builds a privacy-preserving comparison of two immutable debugger snapshots.

Summary metrics expose already-redacted manifest data. Panel payloads are compared structurally, retaining only counts of added, removed, changed, and unchanged JSON leaves instead of copying their values into the overview.

PropertyTypeDescriptionDefined by
$baseline readonlyPHPForge\Debug\Storage\DebugSnapshotBaseline snapshot.HistoryComparison
$metrics readonlylist<PHPForge\Debug\Comparison\SummaryMetricComparison>Request-summary metric comparisons in canonical history order.HistoryComparison
$panels readonlylist<PHPForge\Debug\Comparison\PanelComparison>Per-panel structural comparisons in configured display order.HistoryComparison
$target readonlyPHPForge\Debug\Storage\DebugSnapshotTarget snapshot.HistoryComparison
MethodDescriptionDefined by
fromSnapshots() staticCreates a comparison from two snapshots.HistoryComparison
hasDifferences()Returns whether either summary metrics or panel payloads differ.HistoryComparison
public static function fromSnapshots(PHPForge\Debug\Storage\DebugSnapshot $baseline, PHPForge\Debug\Storage\DebugSnapshot $target, array<string, string> $panelLabels = []): self

Creates a comparison from two snapshots.

Parameters

ParameterTypeDescription
$baselinePHPForge\Debug\Storage\DebugSnapshotCapture used as the reference side of the comparison.
$targetPHPForge\Debug\Storage\DebugSnapshotCapture compared against the baseline.
$panelLabelsarray<string, string>Display names indexed by stable panel ID.

Returns

self: Comparison holding the metric and panel differences between both captures.

public function hasDifferences(): bool

Returns whether either summary metrics or panel payloads differ.

Returns

bool: true when metrics or panel payloads differ; false when the captures match.