Documentation

CaseInsensitiveDictionary
in package
implements ArrayAccess, IteratorAggregate

Case-insensitive dictionary, suitable for HTTP headers

Table of Contents

Interfaces

ArrayAccess
IteratorAggregate

Properties

$data  : array<string|int, mixed>
Actual item data

Methods

__construct()  : mixed
Creates a case insensitive dictionary.
getAll()  : array<string|int, mixed>
Get the headers as an array
getIterator()  : ArrayIterator
Get an iterator for the data
offsetExists()  : bool
Check if the given item exists
offsetGet()  : string|null
Get the value for the item
offsetSet()  : mixed
Set the given item
offsetUnset()  : mixed
Unset the given header

Properties

Methods

__construct()

Creates a case insensitive dictionary.

public __construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
$data : array<string|int, mixed> = []

Dictionary/map to convert to case-insensitive

getAll()

Get the headers as an array

public getAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

Header data

offsetGet()

Get the value for the item

public offsetGet(string $offset) : string|null
Parameters
$offset : string

Item key

Attributes
#[ReturnTypeWillChange]
Return values
string|null

Item value (null if the item key doesn't exist)

offsetSet()

Set the given item

public offsetSet(string $offset, string $value) : mixed
Parameters
$offset : string

Item name

$value : string

Item value

Tags
throws
Exception

On attempting to use dictionary as list (invalidset)

Attributes
#[ReturnTypeWillChange]

        
On this page

Search results