Documentation

AcceptHeaderItem
in package

Represents an Accept-* header item.

Tags
author

Jean-François Simon contact@jfsimon.fr

Table of Contents

$attributes  : mixed
$index  : mixed
$quality  : mixed
$value  : mixed
__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

Methods

__construct()

public __construct(string $value[, array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
$value : string
$attributes : array<string|int, mixed> = []
Return values
mixed

__toString()

Returns header value's string representation.

public __toString() : string
Return values
string

fromString()

Builds an AcceptHeaderInstance instance from a string.

public static fromString(string|null $itemValue) : self
Parameters
$itemValue : string|null
Return values
self

getAttribute()

Returns an attribute by its name.

public getAttribute(string $name[, mixed $default = null ]) : mixed
Parameters
$name : string
$default : mixed = null
Return values
mixed

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
int

getQuality()

Returns the item quality.

public getQuality() : float
Return values
float

getValue()

Returns the item value.

public getValue() : string
Return values
string

hasAttribute()

Tests if an attribute exists.

public hasAttribute(string $name) : bool
Parameters
$name : string
Return values
bool

setAttribute()

Set an attribute.

public setAttribute(string $name, string $value) : $this
Parameters
$name : string
$value : string
Return values
$this

setIndex()

Set the item index.

public setIndex(int $index) : $this
Parameters
$index : int
Return values
$this

setQuality()

Set the item quality.

public setQuality(float $quality) : $this
Parameters
$quality : float
Return values
$this

setValue()

Set the item value.

public setValue(string $value) : $this
Parameters
$value : string
Return values
$this

Search results