Skip to content
PHP Ecosystem
Explore

CompareAction

API reference › Yii3 Debug › Action › CompareAction

final readonly classYii3\Debug\Action\CompareAction
ImplementsDebugActionInterface
Sourcesrc/Action/CompareAction.php

Compares two retained debugger snapshots.

MethodDescriptionDefined by
__construct()Creates the comparison endpoint backed by retained snapshots and the shared page renderer.CompareAction
__invoke()Renders the comparison page for the two captures the query parameters select.CompareAction
public function __construct(PHPForge\Debug\Storage\SnapshotStore $store, Yii3\Debug\Web\DebugPageRenderer $renderer, Psr\Http\Message\ResponseFactoryInterface $responseFactory, Psr\Http\Message\StreamFactoryInterface $streamFactory)

Creates the comparison endpoint backed by retained snapshots and the shared page renderer.

Parameters

ParameterTypeDescription
$storePHPForge\Debug\Storage\SnapshotStoreStore the captured snapshots are read from.
$rendererYii3\Debug\Web\DebugPageRendererRenderer producing the debugger page markup.
$responseFactoryPsr\Http\Message\ResponseFactoryInterfaceFactory building the PSR-7 response.
$streamFactoryPsr\Http\Message\StreamFactoryInterfaceFactory building the PSR-7 response body.
public function __invoke(Psr\Http\Message\ServerRequestInterface $request): Psr\Http\Message\ResponseInterface

Renders the comparison page for the two captures the query parameters select.

Parameters

ParameterTypeDescription
$requestPsr\Http\Message\ServerRequestInterfaceIncoming request carrying the query parameters.

Returns

Psr\Http\Message\ResponseInterface: Rendered page, or a 404 response when the capture is missing.