Skip to content
PHP Ecosystem
Explore

HistoryPanelComparison

API reference › Yii3 Debug › Comparison › HistoryPanelComparison

final readonly classYii3\Debug\Comparison\HistoryPanelComparison
Sourcesrc/Comparison/HistoryPanelComparison.php

Immutable structural-difference summary for one panel across two captured requests.

Counts describe JSON leaf paths only. Captured values are deliberately excluded so the comparison overview cannot reveal data that the individual panels keep behind their own presentation and redaction rules.

PropertyTypeDescriptionDefined by
$id readonly constructorstringStable panel ID.HistoryPanelComparison
$label readonly constructorstringPanel display name.HistoryPanelComparison
MethodDescriptionDefined by
__construct()Creates a comparison summary for one panel across two captures.HistoryPanelComparison
added()Returns the leaves present only in the target capture.HistoryPanelComparison
baselineState()Returns the panel state in the baseline capture.HistoryPanelComparison
changed()Returns the leaves whose value differs between captures.HistoryPanelComparison
differenceCount()Returns how many leaves differ between both captures.HistoryPanelComparison
removed()Returns the leaves present only in the baseline capture.HistoryPanelComparison
targetState()Returns the panel state in the target capture.HistoryPanelComparison
unchanged()Returns the leaves identical in both captures.HistoryPanelComparison
withDifferenceCounts()Returns a copy carrying different JSON-leaf counts.HistoryPanelComparison
withStates()Returns a copy carrying different panel states.HistoryPanelComparison
public function __construct(string $id, string $label, Yii3\Debug\Comparison\HistoryPanelStates $states, Yii3\Debug\Comparison\HistoryPanelDifferenceCounts $counts)

Creates a comparison summary for one panel across two captures.

Parameters

ParameterTypeDescription
$idstringStable panel ID.
$labelstringPanel display name.
$statesHistoryPanelStatesPanel state on each side of the comparison.
$countsHistoryPanelDifferenceCountsJSON-leaf difference counts.
public function added(): int

Returns the leaves present only in the target capture.

Returns

int: JSON leaves present only in the target.

public function baselineState(): string

Returns the panel state in the baseline capture.

Returns

string: State of the panel in the baseline capture.

public function changed(): int

Returns the leaves whose value differs between captures.

Returns

int: JSON leaves present in both with a different value.

public function differenceCount(): int

Returns how many leaves differ between both captures.

Returns

int: Added, removed, and changed leaves combined; unchanged ones are excluded.

public function removed(): int

Returns the leaves present only in the baseline capture.

Returns

int: JSON leaves present only in the baseline.

public function targetState(): string

Returns the panel state in the target capture.

Returns

string: State of the panel in the target capture.

public function unchanged(): int

Returns the leaves identical in both captures.

Returns

int: JSON leaves identical in both captures.

public function withDifferenceCounts(Yii3\Debug\Comparison\HistoryPanelDifferenceCounts $counts): self

Returns a copy carrying different JSON-leaf counts.

Parameters

ParameterTypeDescription
$countsHistoryPanelDifferenceCountsCounts to apply.

Returns

self: Comparison with the counts applied.

public function withStates(Yii3\Debug\Comparison\HistoryPanelStates $states): self

Returns a copy carrying different panel states.

Parameters

ParameterTypeDescription
$statesHistoryPanelStatesStates to apply.

Returns

self: Comparison with the states applied.