src/Enum.php
static function ensureValue($value)
    {
        if (!self::hasValue($value)) {
            throw new InvalidValueException(sprintf(
                'The value %s is not defined in enum class "%s", known values: %s',
                self::dumpValue($value),
                static::class,
                implode(', ', array_map([static::class, 'dumpValue'], self::getValues()))
            ));
        }
    }
static function ensureValue($value)
    {
        if (!self::hasValue($value)) {
            throw new InvalidValueException(sprintf(
                'The value %s is not defined in enum class "%s", known values: %s',
                self::dumpValue($value),
                static::class,
                implode(', ', array_map([static::class, 'dumpValue'], self::getValues()))
            ));
        }
    }
static function ensureValue ( $ value ) { if ( ! self :: hasValue ( $ value ) ) { throw new InvalidValueException ( sprintf ( 'The value %s is not defined in enum class "%s", known values: %s' , self :: dumpValue ( $ value ) , static :: class , implode ( ', ' , array_map ( [ static :: class , 'dumpValue' ] , self :: getValues ( ) ) ) ) ) ; } }
Ensure that a value exists

@throws InvalidValueException if there is no such value
Ensure that a value exists