ServerBag
extends ParameterBag
in package
ServerBag is a container for HTTP headers from the $_SERVER variable.
Tags
Table of Contents
- $parameters : mixed
- Parameter storage.
- __construct() : mixed
- add() : mixed
- Adds parameters.
- all() : array<string|int, mixed>
- Returns the parameters.
- count() : int
- Returns the number of parameters.
- filter() : mixed
- Filter key.
- get() : mixed
- Returns a parameter by name.
- getAlnum() : string
- Returns the alphabetic characters and digits of the parameter value.
- getAlpha() : string
- Returns the alphabetic characters of the parameter value.
- getBoolean() : bool
- Returns the parameter value converted to boolean.
- getDigits() : string
- Returns the digits of the parameter value.
- getHeaders() : array<string|int, mixed>
- Gets the HTTP headers.
- getInt() : int
- Returns the parameter value converted to integer.
- getIterator() : ArrayIterator<string, mixed>
- Returns an iterator for parameters.
- has() : bool
- Returns true if the parameter is defined.
- keys() : array<string|int, mixed>
- Returns the parameter keys.
- remove() : mixed
- Removes a parameter.
- replace() : mixed
- Replaces the current parameters by a new set.
- set() : mixed
- Sets a parameter by name.
Properties
$parameters
Parameter storage.
protected
mixed
$parameters
Methods
__construct()
public
__construct([array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
- $parameters : array<string|int, mixed> = []
Return values
mixed —add()
Adds parameters.
public
add([array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
- $parameters : array<string|int, mixed> = []
Return values
mixed —all()
Returns the parameters.
public
all() : array<string|int, mixed>
Return values
array<string|int, mixed> —count()
Returns the number of parameters.
public
count() : int
Return values
int —filter()
Filter key.
public
filter(string $key[, mixed $default = null ][, int $filter = FILTER_DEFAULT ][, mixed $options = [] ]) : mixed
Parameters
- $key : string
- $default : mixed = null
-
Default = null
- $filter : int = FILTER_DEFAULT
-
FILTER_* constant
- $options : mixed = []
-
Filter options
Tags
Return values
mixed —get()
Returns a parameter by name.
public
get(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
-
The default value if the parameter key does not exist
Return values
mixed —getAlnum()
Returns the alphabetic characters and digits of the parameter value.
public
getAlnum(string $key[, string $default = '' ]) : string
Parameters
- $key : string
- $default : string = ''
Return values
string —getAlpha()
Returns the alphabetic characters of the parameter value.
public
getAlpha(string $key[, string $default = '' ]) : string
Parameters
- $key : string
- $default : string = ''
Return values
string —getBoolean()
Returns the parameter value converted to boolean.
public
getBoolean(string $key[, bool $default = false ]) : bool
Parameters
- $key : string
- $default : bool = false
Return values
bool —getDigits()
Returns the digits of the parameter value.
public
getDigits(string $key[, string $default = '' ]) : string
Parameters
- $key : string
- $default : string = ''
Return values
string —getHeaders()
Gets the HTTP headers.
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —getInt()
Returns the parameter value converted to integer.
public
getInt(string $key, int $default) : int
Parameters
- $key : string
- $default : int
Return values
int —getIterator()
Returns an iterator for parameters.
public
getIterator() : ArrayIterator<string, mixed>
Return values
ArrayIterator<string, mixed> —has()
Returns true if the parameter is defined.
public
has(string $key) : bool
Parameters
- $key : string
Return values
bool —keys()
Returns the parameter keys.
public
keys() : array<string|int, mixed>
Return values
array<string|int, mixed> —remove()
Removes a parameter.
public
remove(string $key) : mixed
Parameters
- $key : string
Return values
mixed —replace()
Replaces the current parameters by a new set.
public
replace([array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
- $parameters : array<string|int, mixed> = []
Return values
mixed —set()
Sets a parameter by name.
public
set(string $key, mixed $value) : mixed
Parameters
- $key : string
- $value : mixed
-
The value