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
$data
Actual item data
protected
array<string|int, mixed>
$data
= []
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
getIterator()
Get an iterator for the data
public
getIterator() : ArrayIterator
Attributes
Return values
ArrayIteratoroffsetExists()
Check if the given item exists
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
-
Item key
Attributes
Return values
bool —Does the item exist?
offsetGet()
Get the value for the item
public
offsetGet(string $offset) : string|null
Parameters
- $offset : string
-
Item key
Attributes
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
Attributes
offsetUnset()
Unset the given header
public
offsetUnset(string $offset) : mixed
Parameters
- $offset : string
-
The key for the item to unset.