Doctrine\DBAL\Migrations\Version::formatParamsForOutput PHP Method

formatParamsForOutput() private method

Formats a set of sql parameters for output with dry run.
private formatParamsForOutput ( array $params, array $types ) : string | null
$params array The query parameters
$types array The types of the query params. Default type is a string
return string | null a string of the parameters present.
    private function formatParamsForOutput(array $params, array $types)
    {
        if (empty($params)) {
            return '';
        }
        $platform = $this->connection->getDatabasePlatform();
        $out = [];
        foreach ($params as $key => $value) {
            $type = isset($types[$key]) ? $types[$key] : 'string';
            $outval = Type::getType($type)->convertToDatabaseValue($value, $platform);
            $out[] = is_string($key) ? sprintf(':%s => %s', $key, $outval) : $outval;
        }
        return sprintf('with parameters (%s)', implode(', ', $out));
    }