Skip to content

Commit

Permalink
Deprecate AbstractHydrator::hydrateRow()
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander M. Turek <[email protected]>
  • Loading branch information
derrabus committed Oct 3, 2021
1 parent 1a70207 commit c95f870
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Upgrade to 2.11

## Deprecated: `AbstractHydrator::hydrateRow()`

Following the deprecation of the method `AbstractHydrator::iterate()`, the
method `hydrateRow()` has been deprecated as well.

# Upgrade to 2.10

## BC Break: Removed `TABLE` id generator strategy
Expand Down
11 changes: 10 additions & 1 deletion lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function __construct(EntityManagerInterface $em)
*/
public function iterate($stmt, $resultSetMapping, array $hints = [])
{
Deprecation::trigger(
Deprecation::triggerIfCalledFromOutside(
'doctrine/orm',
'https://github.com/doctrine/orm/issues/8463',
'Method %s() is deprecated and will be removed in Doctrine ORM 3.0. Use toIterable() instead.',
Expand Down Expand Up @@ -274,10 +274,19 @@ public function hydrateAll($stmt, $resultSetMapping, array $hints = [])
* Hydrates a single row returned by the current statement instance during
* row-by-row hydration with {@link iterate()} or {@link toIterable()}.
*
* @deprecated
*
* @return mixed[]|false
*/
public function hydrateRow()
{
Deprecation::trigger(
'doctrine/orm',
'TODO',
'%s is deprecated.',
__METHOD__
);

$row = $this->statement()->fetchAssociative();

if ($row === false) {
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<!-- We need to keep the calls for DBAL 2.13 compatibility. -->
<referencedMethod name="Doctrine\DBAL\Connection::getSchemaManager"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getGuidExpression"/>
<!-- Remove on 3.0.x -->
<referencedMethod name="Doctrine\ORM\Internal\Hydration\AbstractHydrator::hydrateRow"/>
</errorLevel>
</DeprecatedMethod>
<DocblockTypeContradiction>
Expand Down

0 comments on commit c95f870

Please sign in to comment.