SymfonyComponentHttpFoundationAcceptHeader

Represents an Accept-* header.

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

Summary

No public properties found
No constants found
No protected methods found
No protected properties found
N/A
File
vendorSymfonyComponentHttpFoundationAcceptHeader.php
Package
Default
Class hierarchy
SymfonyComponentHttpFoundationAcceptHeader

Tags

author

Jean-François Simon contact@jfsimon.fr

Properties

$items

$items : array<mixed,\Symfony\Component\HttpFoundation\AcceptHeaderItem>

Type

array<mixed,SymfonyComponentHttpFoundationAcceptHeaderItem>

Tags

None found

$sorted

$sorted : boolean

Type

boolean

Tags

None found

Methods

__construct()

__construct(array<mixed,\Symfony\Component\HttpFoundation\AcceptHeaderItem>  $items) 

Constructor.

Parameters

array<mixed,SymfonyComponentHttpFoundationAcceptHeaderItem> $items

Tags

None found

fromString()

fromString(string  $headerValue) : \Symfony\Component\HttpFoundation\AcceptHeader

Builds an AcceptHeader instance from a string.

Parameters

string $headerValue

Returns

SymfonyComponentHttpFoundationAcceptHeader

static

Tags

None found

__toString()

__toString() : string

Returns header value's string representation.

Returns

string

Tags

None found

has()

has(string  $value) : Boolean

Tests if header has given value.

Parameters

string $value

Returns

Boolean

Tags

None found

get()

get(string  $value) : \Symfony\Component\HttpFoundation\AcceptHeaderItem|null

Returns given value's item, if exists.

Parameters

string $value

Returns

SymfonyComponentHttpFoundationAcceptHeaderItem|null

Tags

None found

add()

add(\Symfony\Component\HttpFoundation\AcceptHeaderItem  $item) : \Symfony\Component\HttpFoundation\AcceptHeader

Adds an item.

Parameters

SymfonyComponentHttpFoundationAcceptHeaderItem $item

Returns

SymfonyComponentHttpFoundationAcceptHeader

Tags

None found

all()

all() : array<mixed,\Symfony\Component\HttpFoundation\AcceptHeaderItem>

Returns all items.

Returns

array<mixed,SymfonyComponentHttpFoundationAcceptHeaderItem>

Tags

None found

filter()

filter(string  $pattern) : \Symfony\Component\HttpFoundation\AcceptHeader

Filters items on their value using given regex.

Parameters

string $pattern

Returns

SymfonyComponentHttpFoundationAcceptHeader

Tags

None found

first()

first() : \Symfony\Component\HttpFoundation\AcceptHeaderItem|null

Returns first item.

Returns

SymfonyComponentHttpFoundationAcceptHeaderItem|null

Tags

None found

sort()

sort() 

Sorts items by descending quality

Tags

None found