Documentation

EnumSet implements ArrayAccess, Countable, IteratorAggregate

Tags
implements

ArrayAccess<Enum, Enum>

implements

IteratorAggregate<int, Enum>

see
https://www.php.net/manual/en/class.arrayaccess.php
see
https://www.php.net/manual/en/class.countable.php
see
https://www.php.net/manual/en/class.iteratoraggregate.php
phpstan-template

T of Enum

phpstan-implements

ArrayAccess<T, T>

phpstan-implements

IteratorAggregate<int, T>

psalm-template

T of Enum

template-implements

ArrayAccess<T, T>

template-implements

IteratorAggregate<int, T>

Interfaces, Classes and Traits

ArrayAccess
Countable
IteratorAggregate

Table of Contents

$enumMap  : EnumMap<Enum, Enum>
allOf()  : EnumSet<string|int, Enum>
Creates an enum set containing all of the elements in the specified element type.
count()  : int
getIterator()  : Traversable<int, Enum>
isEmpty()  : bool
Determines if the enum set is empty or not.
noneOf()  : EnumSet<string|int, Enum>
Creates an empty enum set with the specified element type.
of()  : EnumSet<string|int, Enum>
Creates an enum set initially containing the specified element.
offsetExists()  : bool
offsetGet()  : Enum|null
offsetSet()  : void
offsetUnset()  : void
range()  : EnumSet<string|int, Enum>
Creates an enum set initially containing all of the elements in the range defined by the two specified endpoints.
toArray()  : array<int, Enum>
Gets the enum set of values as a plain array.
__construct()  : mixed
validateEnum()  : void

Properties

Methods

allOf()

Creates an enum set containing all of the elements in the specified element type.

public static allOf(string $class) : EnumSet<string|int, Enum>
Parameters
$class : string
Tags
phpstan-template

TEnum of Enum

phpstan-param

class-string $class

phpstan-return

EnumSet

psalm-template

TEnum of Enum

psalm-param

class-string $class

psalm-return

EnumSet

Return values
EnumSet<string|int, Enum>

isEmpty()

Determines if the enum set is empty or not.

public isEmpty() : bool
Return values
bool

noneOf()

Creates an empty enum set with the specified element type.

public static noneOf(string $class) : EnumSet<string|int, Enum>
Parameters
$class : string
Tags
phpstan-template

TEnum of Enum

phpstan-param

class-string $class

phpstan-return

EnumSet

psalm-template

TEnum of Enum

psalm-param

class-string $class

psalm-return

EnumSet

Return values
EnumSet<string|int, Enum>

of()

Creates an enum set initially containing the specified element.

public static of(Enum $enum) : EnumSet<string|int, Enum>
Parameters
$enum : Enum
Tags
phpstan-template

TEnum of Enum

phpstan-param

TEnum $enum

phpstan-return

EnumSet

psalm-template

TEnum of Enum

psalm-param

TEnum $enum

psalm-return

EnumSet

Return values
EnumSet<string|int, Enum>

range()

Creates an enum set initially containing all of the elements in the range defined by the two specified endpoints.

public static range(Enum $from, Enum $to) : EnumSet<string|int, Enum>
Parameters
$from : Enum
$to : Enum
Tags
phpstan-template

TEnum of Enum

phpstan-param

TEnum $from

phpstan-param

TEnum $to

phpstan-return

EnumSet

psalm-template

TEnum of Enum

psalm-param

TEnum $from

psalm-param

TEnum $to

psalm-return

EnumSet

Return values
EnumSet<string|int, Enum>

toArray()

Gets the enum set of values as a plain array.

public toArray() : array<int, Enum>
Tags
phpstan-return

list

psalm-return

list

Return values
array<int, Enum>

__construct()

private __construct(EnumMap<Enum, Enum$enumMap) : mixed
Parameters
$enumMap : EnumMap<Enum, Enum>
Tags
phpstan-param

EnumMap<T, T> $enumMap

psalm-param

EnumMap<T, T> $enumMap

Return values
mixed

validateEnum()

private static validateEnum(string $class) : void
Parameters
$class : string
Tags
phpstan-param

class-string $class

psalm-param

class-string $class

Return values
void

Search results