Skip to content

Internals Response Interface ResponseInterface

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

response\interface\ResponseInterface

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/response/interface/ResponseInterface.php · Snapshot 8411f4287706.

Response builds status, headers and data/file payloads, chooses a MIME sender, and emits HTTP output. JSON arrays are wrapped in a status/message/data envelope.

ResponseInterface

Declaration and architectural role

interface ResponseInterface

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
status public function status(int $code): static
message public function message(string $message): static
header public function header(string $name, string $value): static
data public function data(array $data): static
file public function file(string $path): static
as public function as(string $mimeType): static
send public function send(): void

status

Source line 7

public function status(int $code): static;

Parameters

Parameter Type, modifiers and default Purpose
$code int $code Operation input; the exact use, validation and propagation are shown in the implementation trace.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

message

Source line 8

public function message(string $message): static;

Parameters

Parameter Type, modifiers and default Purpose
$message string $message Response or exception message text.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

header

Source line 9

public function header(string $name, string $value): static;

Parameters

Parameter Type, modifiers and default Purpose
$name string $name Named key/label selected by this API; its exact scope is shown by the implementation trace.
$value string $value Operation input; the exact use, validation and propagation are shown in the implementation trace.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

data

Source line 10

public function data(array $data): static;

Parameters

Parameter Type, modifiers and default Purpose
$data array $data Input data array or payload; see allowed fields and validation guards below.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

file

Source line 11

public function file(string $path): static;

Parameters

Parameter Type, modifiers and default Purpose
$path string $path Filesystem or route path as defined by the owning component; no universal path normalization is implied.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

as

Source line 14

public function as(string $mimeType): static;

Parameters

Parameter Type, modifiers and default Purpose
$mimeType string $mimeType Operation input; the exact use, validation and propagation are shown in the implementation trace.

Explicitly force a content type (overrides auto-resolution).

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

send

Source line 17

public function send(): void;

Resolve sender from Accept / file extension and emit response.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

Clone this wiki locally