class AcceptHeaderItem

Represents an Accept-* header item.

Methods

__construct(string $value, array $attributes = [])

No description

fromString(string $itemValue)

Builds an AcceptHeaderInstance instance from a string.

string
__toString()

Returns header value's string representation.

$this
setValue(string $value)

Set the item value.

string
getValue()

Returns the item value.

$this
setQuality(float $quality)

Set the item quality.

float
getQuality()

Returns the item quality.

$this
setIndex(int $index)

Set the item index.

int
getIndex()

Returns the item index.

bool
hasAttribute(string $name)

Tests if an attribute exists.

mixed
getAttribute(string $name, mixed $default = null)

Returns an attribute by its name.

array
getAttributes()

Returns all attributes.

$this
setAttribute(string $name, string $value)

Set an attribute.

Details

at line 30
__construct(string $value, array $attributes = [])

Parameters

string $value
array $attributes

at line 45
static AcceptHeaderItem fromString(string $itemValue)

Builds an AcceptHeaderInstance instance from a string.

Parameters

string $itemValue

Return Value

AcceptHeaderItem

at line 72
string __toString()

Returns header value's string representation.

Return Value

string

at line 91
$this setValue(string $value)

Set the item value.

Parameters

string $value

Return Value

$this

at line 103
string getValue()

Returns the item value.

Return Value

string

at line 115
$this setQuality(float $quality)

Set the item quality.

Parameters

float $quality

Return Value

$this

at line 127
float getQuality()

Returns the item quality.

Return Value

float

at line 139
$this setIndex(int $index)

Set the item index.

Parameters

int $index

Return Value

$this

at line 151
int getIndex()

Returns the item index.

Return Value

int

at line 163
bool hasAttribute(string $name)

Tests if an attribute exists.

Parameters

string $name

Return Value

bool

at line 176
mixed getAttribute(string $name, mixed $default = null)

Returns an attribute by its name.

Parameters

string $name
mixed $default

Return Value

mixed

at line 186
array getAttributes()

Returns all attributes.

Return Value

array

at line 199
$this setAttribute(string $name, string $value)

Set an attribute.

Parameters

string $name
string $value

Return Value

$this