Skip to content

ResponseHandle

Minimal façade exposing response operations in no-container execution paths.

Designed to work with WebResponse or legacy Response-compatible objects.

class ResponseHandle

SourceExecution/ResponseHandle.php

public function __construct(object $inner): mixed

ParameterTypeDescription
$innerobject

Returns mixed

MethodDescription
addHeader(string $name, string $value, bool $replace = true): voidSets an HTTP header on the wrapped response, replacing any existing value unless $replace is false.
append(string $content): voidAppends content to the wrapped response; does nothing when it exposes no appendContent().
clear(): voidDiscards the wrapped response’s content; does nothing when it exposes no clearContent().
getContent(): stringReturns the wrapped response’s content, or an empty string when it exposes no getContent().
getInner(): mixedReturns the wrapped response object, for callers needing an API this façade does not expose.
set(string $content): voidReplaces the wrapped response’s content; does nothing when it exposes no setContent().
setStatusCode(int $code): voidSets the wrapped response’s HTTP status code; does nothing when it exposes no setHttpStatusCode().

public function addHeader(string $name, string $value, bool $replace = true): void

Sets an HTTP header on the wrapped response, replacing any existing value unless $replace is false.

Does nothing when the wrapped object exposes no setHttpHeader().

ParameterTypeDescription
$namestring
$valuestring
$replacebool

public function append(string $content): void

Appends content to the wrapped response; does nothing when it exposes no appendContent().

ParameterTypeDescription
$contentstring

public function clear(): void

Discards the wrapped response’s content; does nothing when it exposes no clearContent().

public function getContent(): string

Returns the wrapped response’s content, or an empty string when it exposes no getContent().

Returns string

public function getInner(): mixed

Returns the wrapped response object, for callers needing an API this façade does not expose.

Returns mixed

public function set(string $content): void

Replaces the wrapped response’s content; does nothing when it exposes no setContent().

ParameterTypeDescription
$contentstring

public function setStatusCode(int $code): void

Sets the wrapped response’s HTTP status code; does nothing when it exposes no setHttpStatusCode().

ParameterTypeDescription
$codeint