Skip to content
PHP Ecosystem
Explore

SnapshotComparison

API reference › Debug Core › Comparison › SnapshotComparison

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

Pairs request-summary metrics with per-panel structural differences for two captured snapshots.

PropertyTypeDescriptionDefined by
$baseline readonly constructorPHPForge\Debug\Storage\DebugSnapshotBaseline snapshot.SnapshotComparison
$metrics readonly constructorlist<SummaryMetricComparison>Summary metric comparisons in canonical history order.SnapshotComparison
$panels readonly constructorlist<PanelComparison>Panel comparisons in configured display order.SnapshotComparison
$target readonly constructorPHPForge\Debug\Storage\DebugSnapshotTarget snapshot.SnapshotComparison
MethodDescriptionDefined by
between() staticCompares two snapshots, combining summary metrics with panel structural differences.SnapshotComparison
hasDifferences()Returns whether any summary metric or panel payload differs.SnapshotComparison
public static function between(PHPForge\Debug\Storage\DebugSnapshot $baseline, PHPForge\Debug\Storage\DebugSnapshot $target, array<string, string> $panelLabels = []): self

Compares two snapshots, combining summary metrics with panel structural differences.

Parameters

ParameterTypeDescription
$baselinePHPForge\Debug\Storage\DebugSnapshotBaseline snapshot.
$targetPHPForge\Debug\Storage\DebugSnapshotTarget snapshot.
$panelLabelsarray<string, string>Display names indexed by stable panel ID, in display order.

Returns

self: Comparison pairing summary metrics with per-panel structural differences.

public function hasDifferences(): bool

Returns whether any summary metric or panel payload differs.

Returns

bool: true when at least one metric or panel differs; false otherwise.