src/Type/AbstractStringType.php
public function encode($value, Field $field, Codec $codec = null)
    {
        $value = trim($value);
        if ($value === '') {
            return null;
        }

        return $value;
    }
public function encode($value, Field $field, Codec $codec = null)
    {
        $value = trim($value);
        if ($value === '') {
            return null;
        }

        return $value;
    }
{@inheritdoc}