Type error in Query.php #6846

Closed
opened 2026-01-22 15:39:58 +01:00 by admin · 2 comments
Owner

Originally created by @akosphp on GitHub (Oct 4, 2021).

After upgrading to version 2.10.0 we are facing with the following error:

TypeError in file: Query.php on line 692
Message: Return value of Doctrine\ORM\Query::getMaxResults() must be of the type int or null, string returned

Originally created by @akosphp on GitHub (Oct 4, 2021). After upgrading to version 2.10.0 we are facing with the following error: TypeError in file: Query.php on line 692 Message: Return value of Doctrine\ORM\Query::getMaxResults() must be of the type int or null, string returned
admin closed this issue 2026-01-22 15:39:58 +01:00
Author
Owner

@derrabus commented on GitHub (Oct 4, 2021):

Most likely, this means that you call setMaxResults() with a string somewhere.

@derrabus commented on GitHub (Oct 4, 2021): Most likely, this means that you call `setMaxResults()` with a string somewhere.
Author
Owner

@YetiCGN commented on GitHub (Oct 5, 2021):

I think in most cases it's not userland code but another library. At least that's our problem with 2.10.0 and Sulu 2.3 at the moment. Or maybe it's a driver thing?

setMaxResults() isn't type-safe and doesn't throw a deprecation or other warning so I see why they would happily continue to set the property as a string.

Edit: oic, #9079 is on the way to mitigate the problem. Thanks!

@YetiCGN commented on GitHub (Oct 5, 2021): I think in most cases it's not userland code but another library. At least that's our problem with 2.10.0 and Sulu 2.3 at the moment. Or maybe it's a driver thing? `setMaxResults()` isn't type-safe and doesn't throw a deprecation or other warning so I see why they would happily continue to set the property as a string. Edit: oic, #9079 is on the way to mitigate the problem. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6846