\Symfony\Component\HttpFoundationAcceptHeaderItem

Represents an Accept-* header item.

Summary

Methods
Properties
Constants
__construct()
fromString()
__toString()
setValue()
getValue()
setQuality()
getQuality()
setIndex()
getIndex()
hasAttribute()
getAttribute()
getAttributes()
setAttribute()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$value
$quality
$index
$attributes
N/A

Properties

$value

$value

$quality

$quality

$index

$index

$attributes

$attributes

Methods

__construct()

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

Parameters

string $value
array $attributes

Returns

mixed —

fromString()

fromString(?string  $itemValue) : self

Builds an AcceptHeaderInstance instance from a string.

Parameters

?string $itemValue

Returns

self —

__toString()

__toString() : string

Returns header value's string representation.

Returns

string —

setValue()

setValue(string  $value) : $this

Set the item value.

Parameters

string $value

Returns

$this —

getValue()

getValue() : string

Returns the item value.

Returns

string —

setQuality()

setQuality(float  $quality) : $this

Set the item quality.

Parameters

float $quality

Returns

$this —

getQuality()

getQuality() : float

Returns the item quality.

Returns

float —

setIndex()

setIndex(int  $index) : $this

Set the item index.

Parameters

int $index

Returns

$this —

getIndex()

getIndex() : int

Returns the item index.

Returns

int —

hasAttribute()

hasAttribute(string  $name) : bool

Tests if an attribute exists.

Parameters

string $name

Returns

bool —

getAttribute()

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

Returns an attribute by its name.

Parameters

string $name
mixed $default

Returns

mixed —

getAttributes()

getAttributes() : array

Returns all attributes.

Returns

array —

setAttribute()

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

Set an attribute.

Parameters

string $name
string $value

Returns

$this —