Skip to content

Commit

Permalink
Deprecate getting query parts from QueryBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Oct 10, 2023
1 parent d3954ec commit bc57ca0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ awareness about deprecated code.
- Use of our low-overhead runtime deprecation API, details:
https://github.com/doctrine/deprecations/

# Upgrade to 3.8

## Deprecated getting query parts from `QueryBuilder`

The usage of `QueryBuilder::getQueryPart()` and `::getQueryParts()` is deprecated. The query parts
are implementation details and should not be relied upon.

# Upgrade to 3.6

## Deprecated not setting a schema manager factory
Expand Down
5 changes: 5 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@
-->
<referencedMethod name="Doctrine\DBAL\Connection::getEventManager"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::setEventManager"/>
<!--
TODO: remove in 4.0.0
-->
<referencedMethod name="Doctrine\DBAL\Query\QueryBuilder::getQueryPart"/>
<referencedMethod name="Doctrine\DBAL\Query\QueryBuilder::getQueryParts"/>

<!-- TODO for PHPUnit 10 -->
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::withConsecutive"/>
Expand Down
4 changes: 4 additions & 0 deletions src/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,8 @@ public function addOrderBy($sort, $order = null)
/**
* Gets a query part by its name.
*
* @deprecated The query parts are implementation details and should not be relied upon.
*
* @param string $queryPartName
*
* @return mixed
Expand All @@ -1309,6 +1311,8 @@ public function getQueryPart($queryPartName)
/**
* Gets all query parts.
*
* @deprecated The query parts are implementation details and should not be relied upon.
*
* @return mixed[]
*/
public function getQueryParts()
Expand Down

0 comments on commit bc57ca0

Please sign in to comment.