HistoryComparison
API reference › Debug › widgets › history › HistoryComparison
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.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$baseline readonly | PHPForge\ | Baseline snapshot. | HistoryComparison |
$metrics readonly | list<PHPForge\ | Request-summary metric comparisons in canonical history order. | HistoryComparison |
$panels readonly | list<PHPForge\ | Per-panel structural comparisons in configured display order. | HistoryComparison |
$target readonly | PHPForge\ | Target snapshot. | HistoryComparison |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
fromSnapshots() static | Creates a comparison from two snapshots. | HistoryComparison |
hasDifferences() | Returns whether either summary metrics or panel payloads differ. | HistoryComparison |
Method details
Section titled “Method details”fromSnapshots()
Section titled “fromSnapshots() ”public static function fromSnapshots(PHPForge\Debug\Storage\DebugSnapshot $baseline, PHPForge\Debug\Storage\DebugSnapshot $target, array<string, string> $panelLabels = []): selfCreates a comparison from two snapshots.
Parameters
| Parameter | Type | Description |
|---|---|---|
$baseline | PHPForge\ | Capture used as the reference side of the comparison. |
$target | PHPForge\ | Capture compared against the baseline. |
$panelLabels | array<string, | Display names indexed by stable panel ID. |
Returns
self: Comparison holding the metric and panel differences between both captures.
hasDifferences()
Section titled “hasDifferences() ”public function hasDifferences(): boolReturns whether either summary metrics or panel payloads differ.
Returns
bool: true when metrics or panel payloads differ; false when the captures match.