AcceptHeaderItem
in package
Represents an Accept-* header item.
Tags
Table of Contents
Properties
- $attributes : array<string|int, mixed>
- $index : int
- $quality : float
- $value : string
Methods
- __construct() : mixed
- __toString() : string
- Returns header value's string representation.
- fromString() : self
- Builds an AcceptHeaderInstance instance from a string.
- getAttribute() : mixed
- Returns an attribute by its name.
- getAttributes() : array<string|int, mixed>
- Returns all attributes.
- getIndex() : int
- Returns the item index.
- getQuality() : float
- Returns the item quality.
- getValue() : string
- Returns the item value.
- hasAttribute() : bool
- Tests if an attribute exists.
- setAttribute() : $this
- Set an attribute.
- setIndex() : $this
- Set the item index.
- setQuality() : $this
- Set the item quality.
- setValue() : $this
- Set the item value.
Properties
$attributes
private
array<string|int, mixed>
$attributes
= []
$index
private
int
$index
= 0
$quality
private
float
$quality
= 1.0
$value
private
string
$value
Methods
__construct()
public
__construct(string $value[, array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
- $value : string
- $attributes : array<string|int, mixed> = []
__toString()
Returns header value's string representation.
public
__toString() : string
Return values
stringfromString()
Builds an AcceptHeaderInstance instance from a string.
public
static fromString(string|null $itemValue) : self
Parameters
- $itemValue : string|null
Return values
selfgetAttribute()
Returns an attribute by its name.
public
getAttribute(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
getAttributes()
Returns all attributes.
public
getAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getIndex()
Returns the item index.
public
getIndex() : int
Return values
intgetQuality()
Returns the item quality.
public
getQuality() : float
Return values
floatgetValue()
Returns the item value.
public
getValue() : string
Return values
stringhasAttribute()
Tests if an attribute exists.
public
hasAttribute(string $name) : bool
Parameters
- $name : string
Return values
boolsetAttribute()
Set an attribute.
public
setAttribute(string $name, string $value) : $this
Parameters
- $name : string
- $value : string
Return values
$thissetIndex()
Set the item index.
public
setIndex(int $index) : $this
Parameters
- $index : int
Return values
$thissetQuality()
Set the item quality.
public
setQuality(float $quality) : $this
Parameters
- $quality : float
Return values
$thissetValue()
Set the item value.
public
setValue(string $value) : $this
Parameters
- $value : string