{@inheritdoc}

@param EnumInterface $value
345556
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (null === $value) {
            return $this->onNullFromPhp();
        }

        return $value->getValue();
    }
569448
public function coerce($value)
    {
        $enumValue = $this->getValueLookup()[$value];
        return $enumValue ? $enumValue->getName() : NULL;
    }
1138103
public function set($key, $value = null) : void
    {
        if (is_array($key)) {
            $this->storage  = array_replace_recursive($this->storage, $key);
        } elseif ($value !== null) {
            $key = $this->getCompositeKey($key);
            ArrayHelper::set($this->storage, $key, $value);
        }
        $this->cache->set(self::KEY, $this->storage);
    }
1294931
private function emit($value): Awaitable
    {
        if (null === $this->observable) {
            throw new CompletedError();
        }

        $delayed = $this->delayed;
        $placeholder = $this->placeholder;

        $this->delayed = new Delayed();
        $this->placeholder = new Placeholder($this->delayed);

        $delayed->resolve($value);

        return $placeholder->wait();
    }
225788
public function addEnumValue ($table, $column, $value, $default = false)
		{
			echo "    > add enum value $value to column $column in $table ...\n";
			$time = microtime(true);

			$columnSchema = $this->db->getTableSchema($table)->columns[ $column ];
			$values = $columnSchema->enumValues;
			$values[] = $value;
			$defaultValue = $default ? $value : $columnSchema->defaultValue;
			$this->alterColumn($table, $column, $this->enum($values)->defaultValue($defaultValue));

			echo '    > done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
		}
758940
public static function inEnum($value)
    {
        $allItems = array_flip(self::toArray());

        return isset($allItems[$value]) ? true : false;
    }
1203661
public function setValue($value)
	{
		// set default
		if( $value === "" )
		{
			$value = $this->value;
		}

		if( $this->type === "boolean" )
		{
			$value = is_bool($value) ? $value : in_array($value, ['y', 'yes', 'on', '1']);
		}
		else if( $this->type === "number" )
		{
			if( ! is_numeric($value) )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " must be a number");
			}
			$value = (float) $value;
			if( $this->required && $value === 0 )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " is required");
			}
		}
		else if( $this->type === "enum" )
		{
			if( ! in_array($value, $this->enum, true) )
			{
				$variant = "'" . implode("' or '", $this->enum) . "'";
				throw new \InvalidArgumentException($this->getTheTitle() . " must be equal " . $variant);
			}
		}
		else
		{
			$value = trim($value);
			if( $this->required && ! strlen($value) )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " is required");
			}
		}

		if( $this->type_of )
		{
			$value = call_user_func($this->type_of, $value);
			if( $value === false && $this->type !== "boolean" )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " value is invalid");
			}
		}

		$this->value = $value;
		return $this;
	}
577642
public <E extends Enum<E>> void setProperty(E value)
    {
        manager.setProperty(propertyKey, value);
    }
921708
public static function createByValue($value)
    {
        $constants = self::getConstantsByValue();

        if (!array_key_exists($value, $constants)) {
            throw EnumException::invalidValue(get_called_class(), $value);
        }

        return new static ($value);
    }
785588
public function setAttribute($key, $value)
    {
        if ($this->isEnumAttribute($key)) {
            $enumClass = $this->getEnumClass($key);
            if (! $value instanceof $enumClass) {
                $value = new $enumClass($value);
            }

            $this->attributes[$key] = $value->value();

            return $this;
        }

        parent::setAttribute($key, $value);
    }
665239
@Deprecated
    public static Object enumInit(Object value, Context cx, boolean enumValues)
    {
        return enumInit(value, cx, enumValues ? ENUMERATE_VALUES
                                              : ENUMERATE_KEYS);
    }
500957
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		
		final String inputString = value.toString();
		
		for( final Enum<?> enumConstant : enumClass.getEnumConstants() ) {
			String constantName = enumConstant.name();
			if( ignoreCase ? constantName.equalsIgnoreCase(inputString) : constantName.equals(inputString) ) {
				return enumConstant;
			}
		}
		
		throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a enum of type %s", value,
			enumClass.getName()), context, this);
		
	}
104477
public function setRrn($value)
    {
        if ($value === null || $value === '') {
            $this->_rrn = $value;
        } elseif (TypeCast::canCastToEnumString($value)) {
            $this->_rrn = (string)$value;
        } else {
            throw new InvalidPropertyValueTypeException('Invalid rrn value type', 0,
                'authorization_details.rrn', $value);
        }
    }
479127
public function setReason($value)
    {
        if ($value === null || $value === '') {
            throw new EmptyPropertyValueException('Empty reason value', 0, 'cancellation_details.reason');
        }
        if (TypeCast::canCastToEnumString($value)) {
            $value = strtolower((string)$value);
            if (CancellationDetailsReasonCode::valueExists($value)) {
                $this->_reason = $value;
            } else {
                throw new InvalidPropertyValueException(
                    'Invalid reason value: "'.$value.'"', 0, 'cancellation_details.reason', $value
                );
            }
        } else {
            throw new InvalidPropertyValueTypeException('Invalid reason value type', 0, 'cancellation_details.reason',
                $value);
        }
    }
173096
private function setValue(\DateTimeImmutable $value = null): void
    {
        if ($value === null) {
            $this->value = null;

            return;
        }

        $this->value = $value->setTime(0, 0, 0);
    }
880422
public function setValue($value)
    {
        if (is_array($value)) {
            $value = implode(', ', $value);
        }

        if (!is_null($value)) {
            $this->_value = $value;
            $this->appendChild($value);
        }
    }
1341010
public static function command($value): void
    {
        if (false === self::message($value)) {
            throw new Exception\InvalidCommand($value);
        }
    }