[PR #7441] $hydrationMode throughout can be a string as well as int (for custom modes) #10495

Closed
opened 2026-01-22 16:07:44 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/7441

State: closed
Merged: Yes


As per docs: https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/dql-doctrine-query-language.html#custom-hydration-modes

You can add custom hydration modes. Whilst running phpstan on a project, it discovered that whilst addCustomHydrationMode accepts a string, when you call a method like getResult the $hydrationMode parameter only accepts int and therefore phpstan complains.

I've added string| to all existing type hints.

**Original Pull Request:** https://github.com/doctrine/orm/pull/7441 **State:** closed **Merged:** Yes --- As per docs: https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/dql-doctrine-query-language.html#custom-hydration-modes You can add custom hydration modes. Whilst running phpstan on a project, it discovered that whilst `addCustomHydrationMode` accepts a `string`, when you call a method like `getResult` the `$hydrationMode` parameter only accepts `int` and therefore phpstan complains. I've added `string|` to all existing type hints.
admin added the pull-request label 2026-01-22 16:07:44 +01:00
admin closed this issue 2026-01-22 16:07:44 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#10495