PanelComparison
API reference › Debug Core › Comparison › PanelComparison
Compares observed panels in configured order, combining structural differences with capture-state transitions.
Results retain only identity, labels, states, and counts; source diagnostics are neither copied nor redacted.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$added readonly constructor | int | Leaves present only in the target payload. | PanelComparison |
$baselineState readonly constructor | string | Capture state in the baseline snapshot. | PanelComparison |
$changed readonly constructor | int | Leaves that differ, or 1 for a state-only transition. | PanelComparison |
$id readonly constructor | string | Stable panel ID. | PanelComparison |
$label readonly constructor | string | Display name, falling back to the panel ID. | PanelComparison |
$removed readonly constructor | int | Leaves present only in the baseline payload. | PanelComparison |
$targetState readonly constructor | string | Capture state in the target snapshot. | PanelComparison |
$unchanged readonly constructor | int | Leaves present in both payloads under the same value. | PanelComparison |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
between() static | Compares the union of payload and failure IDs, with observed configured IDs first and sorted extras last. | PanelComparison |
differenceCount() | Returns the total number of structural differences detected for the panel. | PanelComparison |
Constants
Section titled “Constants”| Constant | Value | Description | Defined by |
|---|---|---|---|
STATE_CAPTURED | 'Captured' | Capture state of a panel whose payload reached the snapshot. | PanelComparison |
STATE_FAILED | 'Failed' | Capture state of a panel whose capture failed. | PanelComparison |
STATE_NOT_CAPTURED | 'Not captured' | Capture state of a panel absent from the snapshot. | PanelComparison |
Method details
Section titled “Method details”between()
Section titled “between() ”public static function between(PHPForge\Debug\Storage\DebugSnapshot $baseline, PHPForge\Debug\Storage\DebugSnapshot $target, array<string, string> $panelLabels = []): list<self>Compares the union of payload and failure IDs, with observed configured IDs first and sorted extras last.
Failures take precedence over payloads. A state transition adds one change only when there are no structural additions, removals, or changes; unchanged leaves remain counted even for that state-only transition.
Parameters
| Parameter | Type | Description |
|---|---|---|
$baseline | PHPForge\ | Baseline snapshot. |
$target | PHPForge\ | Target snapshot. |
$panelLabels | array<string, | Display names indexed by stable panel ID, in display order. |
Returns
list<self>: Panel comparisons in configured display order.
differenceCount()
Section titled “differenceCount() ”public function differenceCount(): intReturns the total number of structural differences detected for the panel.
Returns
int: Sum of added, removed, and changed leaves.