AcceptHeader

class AcceptHeader

Represents an Accept-* header.

An accept header is compound with a list of items, sorted by descending quality.

Methods

__construct(array $items)

Constructor.

static AcceptHeader fromString(string $headerValue)

Builds an AcceptHeader instance from a string.

string __toString()

Returns header value's string representation.

bool has(string $value)

Tests if header has given value.

AcceptHeaderItem|null get(string $value)

Returns given value's item, if exists.

AcceptHeader add(AcceptHeaderItem $item)

Adds an item.

AcceptHeaderItem[] all()

Returns all items.

AcceptHeader filter(string $pattern)

Filters items on their value using given regex.

AcceptHeaderItem|null first()

Returns first item.

Details

__construct(array $items)

Constructor.

Parameters

array $items

static AcceptHeader fromString(string $headerValue)

Builds an AcceptHeader instance from a string.

Parameters

string $headerValue

Return Value

AcceptHeader

string __toString()

Returns header value's string representation.

Return Value

string

bool has(string $value)

Tests if header has given value.

Parameters

string $value

Return Value

bool

AcceptHeaderItem|null get(string $value)

Returns given value's item, if exists.

Parameters

string $value

Return Value

AcceptHeaderItem|null

AcceptHeader add(AcceptHeaderItem $item)

Adds an item.

Parameters

AcceptHeaderItem $item

Return Value

AcceptHeader

AcceptHeaderItem[] all()

Returns all items.

Return Value

AcceptHeaderItem[]

AcceptHeader filter(string $pattern)

Filters items on their value using given regex.

Parameters

string $pattern

Return Value

AcceptHeader

AcceptHeaderItem|null first()

Returns first item.

Return Value

AcceptHeaderItem|null
doc_Symfony
2016-10-28 06:04:32
Comments
Leave a Comment

Please login to continue.