src/Enum.php
static function ensureKey(string $key)
    {
        if (!self::hasKey($key)) {
            throw new InvalidKeyException(sprintf(
                'The key "%s" is not defined in enum class "%s", known keys: %s',
                $key,
                static::class,
                implode(', ', self::getKeys())
            ));
        }
    }
static function ensureKey(string $key)
    {
        if (!self::hasKey($key)) {
            throw new InvalidKeyException(sprintf(
                'The key "%s" is not defined in enum class "%s", known keys: %s',
                $key,
                static::class,
                implode(', ', self::getKeys())
            ));
        }
    }
static function ensureKey ( string $ key ) { if ( ! self :: hasKey ( $ key ) ) { throw new InvalidKeyException ( sprintf ( 'The key "%s" is not defined in enum class "%s", known keys: %s' , $ key , static :: class , implode ( ', ' , self :: getKeys ( ) ) ) ) ; } }
Ensure that a key exists

@throws InvalidKeyException if there is no such key
Ensure that a key exists