EnumMap implements ArrayAccess, Countable, IteratorAggregate
Tags
Interfaces, Classes and Traits
- ArrayAccess
- Countable
- IteratorAggregate
Table of Contents
- $keys : array<int, Enum>
- $typedArray : TypedArray<Enum, mixed>
- count() : int
- getIterator() : Traversable<string, mixed>
- isEmpty() : bool
- Determines if the enum map is empty or not.
- new() : EnumMap<Enum, mixed>
- Creates a new instance of the enum map with the specified enum type key.
- offsetExists() : bool
- offsetGet() : mixed|null
- offsetSet() : void
- offsetUnset() : void
- toArray() : array<string, object>
- Gets the enum map of values as a plain array.
- withArrayValue() : EnumMap<Enum, array<int|string, mixed>>
- Returns a new instance of the enum map with the array type value.
- withBoolValue() : EnumMap<Enum, bool>
- Returns a new instance of the enum map with the bool type value.
- withClassValue() : EnumMap<Enum, object>
- Returns a new instance of the enum map with the specified class type value.
- withFloatValue() : EnumMap<Enum, float>
- Returns a new instance of the enum map with the float type value.
- withInterfaceValue() : EnumMap<Enum, object>
- Returns a new instance of the enum map with the class type value that implements the specified interface.
- withIntValue() : EnumMap<Enum, int>
- Returns a new instance of the enum map with the int type value.
- withMixedValue() : EnumMap<Enum, mixed>
- Returns a new instance of the enum map with the mixed type value.
- withObjectValue() : EnumMap<Enum, object>
- Returns a new instance of the enum map with the object type value.
- withResourceValue() : EnumMap<Enum, resource>
- Returns a new instance of the enum map with the resource type value.
- withStringValue() : EnumMap<Enum, string>
- Returns a new instance of the enum map with the string type value.
- withTraitValue() : EnumMap<Enum, object>
- Returns a new instance of the enum map with the class type value that uses the specified trait.
- __construct() : mixed
- validateEnum() : void
Properties
$keys
private
array<int, Enum>
$keys
= []
Tags
$typedArray
private
TypedArray<Enum, mixed>
$typedArray
Tags
Methods
count()
public
count() : int
Tags
Return values
int —getIterator()
public
getIterator() : Traversable<string, mixed>
Tags
Return values
Traversable<string, mixed> —isEmpty()
Determines if the enum map is empty or not.
public
isEmpty() : bool
Return values
bool —new()
Creates a new instance of the enum map with the specified enum type key.
public
static new(string $class) : EnumMap<Enum, mixed>
Parameters
- $class : string
Tags
Return values
EnumMap<Enum, mixed> —offsetExists()
public
offsetExists(Enum $key) : bool
Parameters
- $key : Enum
Tags
Return values
bool —offsetGet()
public
offsetGet(Enum $key) : mixed|null
Parameters
- $key : Enum
Tags
Return values
mixed|null —offsetSet()
public
offsetSet(Enum $key, mixed $value) : void
Parameters
- $key : Enum
- $value : mixed
Tags
Return values
void —offsetUnset()
public
offsetUnset(Enum $key) : void
Parameters
- $key : Enum
Tags
Return values
void —toArray()
Gets the enum map of values as a plain array.
public
toArray() : array<string, object>
Tags
Return values
array<string, object> —withArrayValue()
Returns a new instance of the enum map with the array type value.
public
withArrayValue() : EnumMap<Enum, array<int|string, mixed>>
Tags
Return values
EnumMap<Enum, array<int|string, mixed>> —withBoolValue()
Returns a new instance of the enum map with the bool type value.
public
withBoolValue() : EnumMap<Enum, bool>
Tags
Return values
EnumMap<Enum, bool> —withClassValue()
Returns a new instance of the enum map with the specified class type value.
public
withClassValue(string $class) : EnumMap<Enum, object>
Parameters
- $class : string
Tags
Return values
EnumMap<Enum, object> —withFloatValue()
Returns a new instance of the enum map with the float type value.
public
withFloatValue() : EnumMap<Enum, float>
Tags
Return values
EnumMap<Enum, float> —withInterfaceValue()
Returns a new instance of the enum map with the class type value that implements the specified interface.
public
withInterfaceValue(string $interface) : EnumMap<Enum, object>
Parameters
- $interface : string
Tags
Return values
EnumMap<Enum, object> —withIntValue()
Returns a new instance of the enum map with the int type value.
public
withIntValue() : EnumMap<Enum, int>
Tags
Return values
EnumMap<Enum, int> —withMixedValue()
Returns a new instance of the enum map with the mixed type value.
public
withMixedValue() : EnumMap<Enum, mixed>
Tags
Return values
EnumMap<Enum, mixed> —withObjectValue()
Returns a new instance of the enum map with the object type value.
public
withObjectValue() : EnumMap<Enum, object>
Tags
Return values
EnumMap<Enum, object> —withResourceValue()
Returns a new instance of the enum map with the resource type value.
public
withResourceValue() : EnumMap<Enum, resource>
Tags
Return values
EnumMap<Enum, resource> —withStringValue()
Returns a new instance of the enum map with the string type value.
public
withStringValue() : EnumMap<Enum, string>
Tags
Return values
EnumMap<Enum, string> —withTraitValue()
Returns a new instance of the enum map with the class type value that uses the specified trait.
public
withTraitValue(string $trait) : EnumMap<Enum, object>
Parameters
- $trait : string
Tags
Return values
EnumMap<Enum, object> —__construct()
private
__construct(TypedArray<Enum, mixed> $typedArray) : mixed
Parameters
- $typedArray : TypedArray<Enum, mixed>
Tags
Return values
mixed —validateEnum()
private
static validateEnum(string $class) : void
Parameters
- $class : string