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

        if (!$this->decodeFromBase64) {
            return $value;
        }

        $value = base64_decode($value, true);

        if (false === $value) {
            throw new DecodeValueFailed($value, $field, 'Strict base64_decode failed.');
        }

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

        if (!$this->decodeFromBase64) {
            return $value;
        }

        $value = base64_decode($value, true);

        if (false === $value) {
            throw new DecodeValueFailed($value, $field, 'Strict base64_decode failed.');
        }

        return $value;
    }
{@inheritdoc}