src/Enum.php
public static function getAllInstances()
    {
        try {
            $instances = array();

            foreach (static::getAllNames() as $name) {
                $instances[] = static::byName($name);
            }

            return $instances;
        } catch (Enum\Exception\InvalidInstance $e) {
            throw new LogicException("All valid names should produce valid instances?");
        }
    }
public static function getAllInstances()
    {
        try {
            $instances = array();

            foreach (static::getAllNames() as $name) {
                $instances[] = static::byName($name);
            }

            return $instances;
        } catch (Enum\Exception\InvalidInstance $e) {
            throw new LogicException("All valid names should produce valid instances?");
        }
    }
public static function getAllInstances ( ) { try { $ instances = array ( ) ; foreach ( static :: getAllNames ( ) as $ name ) { $ instances [ ] = static :: byName ( $ name ) ; } return $ instances ; } catch ( Enum \ Exception \ InvalidInstance $ e ) { throw new LogicException ( "All valid names should produce valid instances?" ) ; } }
Gets an array of all possible instances.

<br/>

For example:

<br/>

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

@return static[]
Gets an array of all possible instances .