I've double-checked the code, and it can only return `null` if the parameter name does not exist for this query, which is an error IMO. So I'd change the code for:

    $parameter = $this->query->getParameter($inputParam->name);
    
    if (! $parameter) {
        throw QueryException::unknownParameter($inputParam->name);
    }
    
    if (is_string($parameter->getType())) {
        $parameterType = Type::getType($parameter->getType());
        return $parameterType->convertToDatabaseValueSQL('?', $this->platform);
    }

This code has an extra consequence then:
If your DQL contains a parameter such as `:name`, and you don't call `->setParameter('name', ...)`, it will throw a QueryException. Right now, this is not the case. @beberlei , could you please comment on this?