src/Enum.php
public static function getAllNames()
    {
        $className = get_called_class();

        if (!array_key_exists($className, self::$constantsArray)) {
            try {
                $class = new ReflectionClass($className);
            } catch (ReflectionException $e) {
                throw new RuntimeException($e->getMessage(), (int)$e->getCode(), $e);
            }

            self::$constantsArray[$className] = array_keys($class->getConstants());
        }

        return self::$constantsArray[$className];
    }
public static function getAllNames()
    {
        $className = get_called_class();

        if (!array_key_exists($className, self::$constantsArray)) {
            try {
                $class = new ReflectionClass($className);
            } catch (ReflectionException $e) {
                throw new RuntimeException($e->getMessage(), (int)$e->getCode(), $e);
            }

            self::$constantsArray[$className] = array_keys($class->getConstants());
        }

        return self::$constantsArray[$className];
    }
public static function getAllNames ( ) { $ className = get_called_class ( ) ; if ( ! array_key_exists ( $ className , self :: $ constantsArray ) ) { try { $ class = new ReflectionClass ( $ className ) ; } catch ( ReflectionException $ e ) { throw new RuntimeException ( $ e -> getMessage ( ) , ( int ) $ e -> getCode ( ) , $ e ) ; } self :: $ constantsArray [ $ className ] = array_keys ( $ class -> getConstants ( ) ) ; } return self :: $ constantsArray [ $ className ] ; }
Gets an array of all possible instances' label names.

<br/>

For example:

<br/>

```
Fruit::getAllNames(); // ['APPLE', 'BANANA']
```

@return string[]
Gets an array of all possible instances label names .