final class ResolvedRequestContext (View source)

Captures one immutable, trust-aware view of externally visible request metadata.

Methods

__construct(string|null $peerIp, string|null $clientIp, bool $viaTrustedProxy, string $scheme, string|null $host, int|null $port, string $prefix)

Stores peer identity, resolved client identity and the validated external request origin.

string|null
peerIp()

Returns the direct network peer reported by the server request.

string|null
string|null

Returns the first client address outside the trusted proxy chain.

string|null
bool

Reports whether the immediate peer belongs to an explicitly trusted proxy network.

bool
string
scheme()

Returns the resolved external HTTP scheme.

string
bool
secure()

Reports whether the resolved external request used HTTPS.

bool
string|null
host()

Returns an allowlisted host without brackets, or null when no request-derived host was approved.

string|null
int|null
port()

Returns a non-default external port, or null when the scheme default applies.

int|null
string
prefix()

Returns the normalized external application prefix, or an empty string when none was trusted.

string

Details

__construct

__construct(string|null $peerIp, string|null $clientIp, bool $viaTrustedProxy, string $scheme, string|null $host, int|null $port, string $prefix)

Stores peer identity, resolved client identity and the validated external request origin.

Parameters

string|null $peerIp
string|null $clientIp
bool $viaTrustedProxy
string $scheme
string|null $host
int|null $port
string $prefix

peerIp

string|null peerIp()

Returns the direct network peer reported by the server request.

Return Value

string|null

clientIp

string|null clientIp()

Returns the first client address outside the trusted proxy chain.

Return Value

string|null

viaTrustedProxy

bool viaTrustedProxy()

Reports whether the immediate peer belongs to an explicitly trusted proxy network.

Return Value

bool

scheme

string scheme()

Returns the resolved external HTTP scheme.

Return Value

string

secure

bool secure()

Reports whether the resolved external request used HTTPS.

Return Value

bool

host

string|null host()

Returns an allowlisted host without brackets, or null when no request-derived host was approved.

Return Value

string|null

port

int|null port()

Returns a non-default external port, or null when the scheme default applies.

Return Value

int|null

prefix

string prefix()

Returns the normalized external application prefix, or an empty string when none was trusted.

Return Value

string