Skip to content
PHP Ecosystem
Explore

HistoryComparison

API reference › Yii3 Debug › Comparison › HistoryComparison

final readonly classYii3\Debug\Comparison\HistoryComparison
Sourcesrc/Comparison/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 readonly constructorlist<HistoryMetricComparison>Request-summary metric comparisons.HistoryComparison
$panels readonly constructorlist<HistoryPanelComparison>Per-panel structural comparisons.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.