ServerBag
final class ServerBag (View source)
Preserves the server-bag API while delegating trusted values to the central request policy.
Methods
Binds the bag to one request-scoped server helper.
Returns the raw server-parameter snapshot from the explicit PSR request.
Returns one raw server parameter or the supplied fallback when absent.
Returns the allowlisted host or the explicit fallback when no host was trusted.
Returns the scheme established by the central request trust policy.
Returns the verified client address or the explicit fallback when unavailable.
Details
all
array
all()
Returns the raw server-parameter snapshot from the explicit PSR request.
get
mixed
get(string $key, mixed $default = null)
Returns one raw server parameter or the supplied fallback when absent.
host
string
host(string $default = 'localhost')
Returns the allowlisted host or the explicit fallback when no host was trusted.
scheme
string
scheme()
Returns the scheme established by the central request trust policy.
ip
string|null
ip(string|null $default = null)
Returns the verified client address or the explicit fallback when unavailable.