Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.28 KB

Class_AbstractAutoEnum.md

File metadata and controls

40 lines (27 loc) · 1.28 KB

AbstractAutoEnum Base Class

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.

Class Details

Method Reference

  • static all (): array
    Returns a list of all public constant values in this class (as an associative array with the constants' names as keys).

Inherited Methods

  • 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.