Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate AbstractMySQLPlatform::getColumnTypeSQLSnippets() #6213

Merged
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ awareness about deprecated code.

# Upgrade to 3.8

## Deprecated `AbstractMySQLPlatform::getColumnTypeSQLSnippets()`

`AbstractMySQLPlatform::getColumnTypeSQLSnippets()` has been deprecated.
Use `AbstractMySQLPlatform::getColumnTypeSQLSnippet()` instead.

## Deprecated reset methods from `QueryBuilder`

`QueryBuilder::resetQueryParts()` has been deprecated.
Expand Down
5 changes: 5 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@
<referencedMethod name="Doctrine\DBAL\Query\QueryBuilder::getQueryParts"/>
<referencedMethod name="Doctrine\DBAL\Query\QueryBuilder::resetQueryPart"/>
<referencedMethod name="Doctrine\DBAL\Query\QueryBuilder::resetQueryParts"/>
<!--
See https://github.com/doctrine/dbal/pull/6202
TODO: remove in 4.0.0
-->
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractMySQLPlatform::getColumnTypeSQLSnippets" />

<!-- TODO for PHPUnit 10 -->
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::withConsecutive"/>
Expand Down
9 changes: 9 additions & 0 deletions src/Platforms/AbstractMySQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ public function getListTableColumnsSQL($table, $database = null)
}

/**
* @deprecated Use {@see getColumnTypeSQLSnippet()} instead.
*
* The SQL snippets required to elucidate a column type
*
* Returns an array of the form [column type SELECT snippet, additional JOIN statement snippet]
Expand All @@ -406,6 +408,13 @@ public function getListTableColumnsSQL($table, $database = null)
*/
public function getColumnTypeSQLSnippets(string $tableAlias = 'c'): array
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/6202',
'AbstractMySQLPlatform::getColumnTypeSQLSnippets() is deprecated. '
. 'Use AbstractMySQLPlatform::getColumnTypeSQLSnippet() instead.',
);

return [$this->getColumnTypeSQLSnippet(...func_get_args()), ''];
}

Expand Down