ParameterHeader extends AbstractHeader
Represents a header containing a primary value part and subsequent name/value parts using a ParameterConsumer.
Tags
Table of Contents
- $name : string
- $parameters : array<string|int, ParameterPart>
- $parts : array<string|int, HeaderPart>
- $rawValue : string
- __construct() : mixed
- Assigns the header's name and raw value, then calls getConsumer and setParseHeaderValue to extract a parsed value.
- __toString() : string
- Returns the string representation of the header. At the moment this is just in the form of:
- getName() : string
- Returns the name of the header.
- getParts() : array<string|int, HeaderPart>
- Returns an array of HeaderPart objects associated with this header.
- getRawValue() : string
- Returns the raw value of the header prior to any processing.
- getValue() : string
- Returns the parsed value of the header -- calls getValue on $this->part
- getValueFor() : string
- Returns the value of the parameter with the given name, or $defaultValue if not set.
- hasParameter() : bool
- Returns true if a parameter exists with the passed name.
- getConsumer() : AbstractConsumer
- Returns a ParameterConsumer.
- setParseHeaderValue() : mixed
- Overridden to assign ParameterParts to a map of lower-case parameter names to ParameterParts.
Properties
$name
protected
string
$name
$parameters
protected
array<string|int, ParameterPart>
$parameters
= []
$parts
protected
array<string|int, HeaderPart>
$parts
$rawValue
protected
string
$rawValue
Methods
__construct()
Assigns the header's name and raw value, then calls getConsumer and setParseHeaderValue to extract a parsed value.
public
__construct(ConsumerService $consumerService, string $name, string $value) : mixed
Parameters
- $consumerService : ConsumerService
- $name : string
- $value : string
Return values
mixed —__toString()
Returns the string representation of the header. At the moment this is just in the form of:
public
__toString() : string
No additional processing is performed (for instance to wrap long lines.)
Return values
string —getName()
Returns the name of the header.
public
getName() : string
Return values
string —getParts()
Returns an array of HeaderPart objects associated with this header.
public
getParts() : array<string|int, HeaderPart>
Return values
array<string|int, HeaderPart> —getRawValue()
Returns the raw value of the header prior to any processing.
public
getRawValue() : string
Return values
string —getValue()
Returns the parsed value of the header -- calls getValue on $this->part
public
getValue() : string
Return values
string —getValueFor()
Returns the value of the parameter with the given name, or $defaultValue if not set.
public
getValueFor(string $name[, string $defaultValue = null ]) : string
Parameters
- $name : string
- $defaultValue : string = null
Return values
string —hasParameter()
Returns true if a parameter exists with the passed name.
public
hasParameter(string $name) : bool
Parameters
- $name : string
Return values
bool —getConsumer()
Returns a ParameterConsumer.
protected
getConsumer(ConsumerService $consumerService) : AbstractConsumer
Parameters
- $consumerService : ConsumerService
Return values
AbstractConsumer —setParseHeaderValue()
Overridden to assign ParameterParts to a map of lower-case parameter names to ParameterParts.
protected
setParseHeaderValue(AbstractConsumer $consumer) : mixed
Parameters
- $consumer : AbstractConsumer