public static function validate($value, $strict = true)
    {
        if (static::isValidValue($value, $strict) === false) {
            throw new InvalidEnumValueException(static::getConstants());
        }
        return $value;
    }
public static function validate($value, $strict = true)
    {
        if (static::isValidValue($value, $strict) === false) {
            throw new InvalidEnumValueException(static::getConstants());
        }
        return $value;
    }
public static function validate ( $ value , $ strict = true ) { if ( static :: isValidValue ( $ value , $ strict ) === false ) { throw new InvalidEnumValueException ( static :: getConstants ( ) ) ; } return $ value ; }
Returns validated value for this enum class or throws exception if not.

@param mixed $value value to be checked
@param bool $strict If strict comparison should be used or not
@return mixed validated value
@throws InvalidEnumValueException
Returns validated value for this enum class or throws exception if not .