src/Type/StringEnumType.php
public function encode($value, Field $field, Codec $codec = null)
    {
        if ($value instanceof Enum) {
            return (string) $value->getValue();
        }

        return null;
    }
public function encode($value, Field $field, Codec $codec = null)
    {
        if ($value instanceof Enum) {
            return (string) $value->getValue();
        }

        return null;
    }
{@inheritdoc}