BackedEnum
interface BackedEnum implements UnitEnum (View source)
Properties
int|string | $value |
Methods
static BackedEnum
from(int|string $value)
Translates a string or int into the corresponding Enum
case, if any. If there is no matching case defined, it will throw a
ValueError
.
static BackedEnum|null
tryFrom(int|string $value)
Translates a string or int into the corresponding Enum
case, if any. If there is no matching case defined, it will return null.
Details
static array
cases()
No description
static BackedEnum
from(int|string $value)
Translates a string or int into the corresponding Enum
case, if any. If there is no matching case defined, it will throw a
ValueError
.
static BackedEnum|null
tryFrom(int|string $value)
Translates a string or int into the corresponding Enum
case, if any. If there is no matching case defined, it will return null.