SymfonyComponentHttpFoundationServerBag

ServerBag is a container for HTTP headers from the $_SERVER variable.

Summary

No protected methods found
N/A
No private methods found
No private properties found
N/A
File
vendorSymfonyComponentHttpFoundationServerBag.php
Package
Default
Class hierarchy
SymfonyComponentHttpFoundationServerBag

Tags

author

Fabien Potencier fabien@symfony.com

Bulat Shakirzyanov mallluhuct@gmail.com

Robert Kiss kepten@gmail.com

Properties

$parameters

$parameters : array

Parameter storage.

Type

array

Inherited from
SymfonyComponentHttpFoundationParameterBag

Tags

None found

Methods

__construct()

__construct(array  $parameters = array()) 

Constructor.

Parameters

array $parameters

An array of parameters

all()

all() : array

Returns the parameters.

Returns

array —

An array of parameters

keys()

keys() : array

Returns the parameter keys.

Returns

array —

An array of parameter keys

replace()

replace(array  $parameters = array()) 

Replaces the current parameters by a new set.

Parameters

array $parameters

An array of parameters

add()

add(array  $parameters = array()) 

Adds parameters.

Parameters

array $parameters

An array of parameters

get()

get(string  $path, mixed  $default = null, boolean  $deep = false) : mixed

Returns a parameter by name.

Parameters

string $path

The key

mixed $default

The default value if the parameter key does not exist

boolean $deep

If true, a path like foo[bar] will find deeper items

Throws

InvalidArgumentException

Returns

mixed

set()

set(string  $key, mixed  $value) 

Sets a parameter by name.

Parameters

string $key

The key

mixed $value

The value

has()

has(string  $key) : Boolean

Returns true if the parameter is defined.

Parameters

string $key

The key

Returns

Boolean —

true if the parameter exists, false otherwise

remove()

remove(string  $key) 

Removes a parameter.

Parameters

string $key

The key

getAlpha()

getAlpha(string  $key, mixed  $default = '', boolean  $deep = false) : string

Returns the alphabetic characters of the parameter value.

Parameters

string $key

The parameter key

mixed $default

The default value if the parameter key does not exist

boolean $deep

If true, a path like foo[bar] will find deeper items

Returns

string —

The filtered value

getAlnum()

getAlnum(string  $key, mixed  $default = '', boolean  $deep = false) : string

Returns the alphabetic characters and digits of the parameter value.

Parameters

string $key

The parameter key

mixed $default

The default value if the parameter key does not exist

boolean $deep

If true, a path like foo[bar] will find deeper items

Returns

string —

The filtered value

getDigits()

getDigits(string  $key, mixed  $default = '', boolean  $deep = false) : string

Returns the digits of the parameter value.

Parameters

string $key

The parameter key

mixed $default

The default value if the parameter key does not exist

boolean $deep

If true, a path like foo[bar] will find deeper items

Returns

string —

The filtered value

getInt()

getInt(string  $key, mixed  $default, boolean  $deep = false) : integer

Returns the parameter value converted to integer.

Parameters

string $key

The parameter key

mixed $default

The default value if the parameter key does not exist

boolean $deep

If true, a path like foo[bar] will find deeper items

Returns

integer —

The filtered value

filter()

filter(string  $key, mixed  $default = null, boolean  $deep = false, integer  $filter = FILTER_DEFAULT, mixed  $options = array()) : mixed

Filter key.

Parameters

string $key

Key.

mixed $default

Default = null.

boolean $deep

Default = false.

integer $filter

FILTER_* constant.

mixed $options

Filter options.

Returns

mixed

Inherited from
SymfonyComponentHttpFoundationParameterBag
See also

Tags

None found

getIterator()

getIterator() : \ArrayIterator

Returns an iterator for parameters.

Returns

ArrayIterator —

An ArrayIterator instance

Inherited from
SymfonyComponentHttpFoundationParameterBag

Tags

None found

count()

count() : integer

Returns the number of parameters.

Returns

integer —

The number of parameters

Inherited from
SymfonyComponentHttpFoundationParameterBag

Tags

None found

getHeaders()

getHeaders() : array

Gets the HTTP headers.

Returns

array

Tags

None found