final class HttpDiagnosticsHeaders (View source)

Exposes a completed summary through headers without reading or replacing the response body.

Methods

Uses only the explicit exposure policy, with no dependency on application environment.

ResponseInterface
apply(ResponseInterface $response, HttpMetrics $metrics)

Returns the exact response when disabled and changes only four diagnostic headers when enabled.

ResponseInterface

Details

__construct

__construct(HttpDiagnosticsConfig $config)

Uses only the explicit exposure policy, with no dependency on application environment.

Parameters

HttpDiagnosticsConfig $config

apply

ResponseInterface apply(ResponseInterface $response, HttpMetrics $metrics)

Returns the exact response when disabled and changes only four diagnostic headers when enabled.

Existing body metadata and stream state are preserved, including for HEAD and streamed responses.

Parameters

ResponseInterface $response
HttpMetrics $metrics

Return Value

ResponseInterface