class ParameterMapSerializer (View source)

Constants

OPTION_DELIMITER

OPTION_PATTERN

ParameterMap unserialization option.

A PCRE pattern that MUST contains at least a group for parameter named and a group for the value.

Name and value groups are defined by the OPTION_NAME_PATTERN_GROUPS and OPTION_VALUE_PATTERN_GROUPS

OPTION_NAME_PATTERN_GROUPS

OPTION_VALUE_PATTERN_GROUPS

ParameterMap unserialization option.

Array of pattern group indexes where the parameter value could be.

If the array entry is a {int, callable} pair, the callable will be applied on the pattern group value.

OPTION_WHITESPACE_PATTERN

ParameterMap unserialization option.

Whitespace pattern

OPTION_ACCEPT_CALLBACK

ParameterMap unserialization option.

A callback invoked each time a parameter and its value is found .in @c $text The callable should accept 2 arguments (name, value) and return an integer as follow

  • > 1 if the parameter is accepted
  • 0 if the marameter should be ignored
  • < 0 if the parsing must be aborted

ACCEPT

Parameter map unserialization acceptance function result.

Indicates the parameter key/value pair can be added to the parameter map

IGNORE

Parameter map unserialization acceptance function result.

Indicates the current key/value pair must be ignored.

ABORT

Parameter map unserialization acceptance function result.

Indicates the current key/value pair must be ignored and the parsing process mustbe aborted.

Methods

static 
serializeParameters($parameters, $glue = '; ')

No description

static integer
unserializeParameters(ArrayAccess|array $parameters, string $text, array $options = array())

No description

Details

static serializeParameters($parameters, $glue = '; ')

Parameters

$parameters
$glue

static integer unserializeParameters(ArrayAccess|array $parameters, string $text, array $options = array())

Parameters

ArrayAccess|array $parameters
string $text
array $options

Return Value

integer number of bytes of $text consumed