Skip to content

Commit

Permalink
Deprecate AbstractMySQLPlatform::getColumnTypeSQLSnippets() (#6213)
Browse files Browse the repository at this point in the history
|      Q       |   A
|------------- | -----------
| Type         | improvement
| Fixed issues |
#6202 (comment)

#### Summary

Deprecates `AbstractMySQLPlatform::getColumnTypeSQLSnippets()`

~~Needs to be rebased after #6202
got merged upstream.~~ Done.

---------

Co-authored-by: Alexander M. Turek <me@derrabus.de>
  • Loading branch information
ausi and derrabus committed Nov 5, 2023
1 parent 706007b commit 39fe3b4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
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

0 comments on commit 39fe3b4

Please sign in to comment.