[PR #9079] Add integer cast in setMaxResults methods of Query and QueryBuilder #11359

Open
opened 2026-01-22 16:10:31 +01:00 by admin · 0 comments
Owner

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

State: closed
Merged: Yes


Hello there 👋

This is my first PR here 😁 Hope, I have done it right.

With version 2.9.6 a native return type was added to the Doctrine\ORM\Query::getMaxResults() method.
To prevent type errors in userland due to wrong usage, an integer cast while setting the max result property was added.

Alternatively a native type to the parameter could be set. But I don't know, if this would be breaking.
Psalm is failing due to a redundant cast, which is obvious 🙈

Nevertheless I wanted to hear you opinions, whether this could be merged or if I need to fix our 50+ wrong usages 😬

Best regards 🙂

**Original Pull Request:** https://github.com/doctrine/orm/pull/9079 **State:** closed **Merged:** Yes --- Hello there :wave: This is my first PR here :grin: Hope, I have done it right. With version 2.9.6 a native return type was added to the `Doctrine\ORM\Query::getMaxResults()` method. To prevent type errors in userland due to wrong usage, an integer cast while setting the max result property was added. Alternatively a native type to the parameter could be set. But I don't know, if this would be breaking. Psalm is failing due to a redundant cast, which is obvious :see_no_evil: Nevertheless I wanted to hear you opinions, whether this could be merged or if I need to fix our 50+ wrong usages :grimacing: Best regards :slightly_smiling_face:
admin added the pull-request label 2026-01-22 16:10:31 +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#11359