ResponseHandle
Minimal façade exposing response operations in no-container execution paths.
Designed to work with WebResponse or legacy Response-compatible objects.
Synopsis
Section titled “Synopsis”class ResponseHandle
| Source | Execution/ResponseHandle.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(object $inner): mixed
| Parameter | Type | Description |
|---|---|---|
$inner | object |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
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. |
append(string $content): void | Appends content to the wrapped response; does nothing when it exposes no appendContent(). |
clear(): void | Discards the wrapped response’s content; does nothing when it exposes no clearContent(). |
getContent(): string | Returns the wrapped response’s content, or an empty string when it exposes no getContent(). |
getInner(): mixed | Returns the wrapped response object, for callers needing an API this façade does not expose. |
set(string $content): void | Replaces the wrapped response’s content; does nothing when it exposes no setContent(). |
setStatusCode(int $code): void | Sets the wrapped response’s HTTP status code; does nothing when it exposes no setHttpStatusCode(). |
addHeader()
Section titled “addHeader()”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().
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$value | string | |
$replace | bool |
append()
Section titled “append()”public function append(string $content): void
Appends content to the wrapped response; does nothing when it exposes no appendContent().
| Parameter | Type | Description |
|---|---|---|
$content | string |
clear()
Section titled “clear()”public function clear(): void
Discards the wrapped response’s content; does nothing when it exposes no clearContent().
getContent()
Section titled “getContent()”public function getContent(): string
Returns the wrapped response’s content, or an empty string when it exposes no getContent().
Returns string
getInner()
Section titled “getInner()”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().
| Parameter | Type | Description |
|---|---|---|
$content | string |
setStatusCode()
Section titled “setStatusCode()”public function setStatusCode(int $code): void
Sets the wrapped response’s HTTP status code; does nothing when it exposes no setHttpStatusCode().
| Parameter | Type | Description |
|---|---|---|
$code | int |