This base class contains a default all()
implementation
that always returns the values of all public class constants.
This makes writing usable enum classes very easy: extend this class, put some constants in it, done.
- Declaration:
class mle86\Enum\AbstractAutoEnum extends mle86\Enum\AbstractEnum
. - Class file: src/AbstractAutoEnum.php
static all (): array
Returns a list of all public constant values in this class (as an associative array with the constants' names as keys).
- Constructor:
__construct ($value)
static isValid ($value): bool
static validate ($value, string $forKey = null): void
static validateOptional ($value, string $forKey = null): void
value (): mixed
jsonSerialize (): mixed
__toString (): string
equals ($value): bool
All inherited methods are documented in the AbstractEnum class documentation.