Doctrineum/Scalar/ScalarEnumType.php
public function convertToPHPValue($value, AbstractPlatform $platform): ?ScalarEnumInterface
    {
        return $value === null
            ? null
            : $this->convertToEnum($value);
    }
public function convertToPHPValue($value, AbstractPlatform $platform): ?ScalarEnumInterface
    {
        return $value === null
            ? null
            : $this->convertToEnum($value);
    }
Convert database string value to Enum instance
This does NOT cast non-string scalars into string (integers, floats etc).
Even null remains null in returned Enum.
(But saving the value into database and pulling it back probably will do the to-string conversion)

@param string|int|float|bool|null $value
@param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
@return ScalarEnum|null
@throws \Doctrineum\Scalar\Exceptions\UnexpectedValueToEnum
@throws \Doctrineum\Scalar\Exceptions\CouldNotDetermineEnumClass
@throws \Doctrineum\Scalar\Exceptions\EnumClassNotFound
@throws \Granam\ScalarEnum\Exceptions\CanNotCreateInstanceOfAbstractEnum