[PR #11579] Precise EntityRepository::count return type #13107

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

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

State: closed
Merged: Yes


Such PR was introduced on PHPStan side https://github.com/phpstan/phpstan-doctrine/pull/604/files

Either it's false, either it's true and should be directly added to the ORM code.
I already saw multiple @psalm-return 0|positive-int occurences, so I used the same syntax.

Psalm does not understand that in the BasicEntityPersister, 'SELECT COUNT(*) ... returns a positive int ; should I add the error to the baseline or typehint the result in a temporary variable ? (WDY prefer @greg0ire)

**Original Pull Request:** https://github.com/doctrine/orm/pull/11579 **State:** closed **Merged:** Yes --- Such PR was introduced on PHPStan side https://github.com/phpstan/phpstan-doctrine/pull/604/files Either it's false, either it's true and should be directly added to the ORM code. I already saw multiple `@psalm-return 0|positive-int` occurences, so I used the same syntax. Psalm does not understand that in the `BasicEntityPersister`, `'SELECT COUNT(*) ...` returns a positive int ; should I add the error to the baseline or typehint the result in a temporary variable ? (WDY prefer @greg0ire)
admin added the pull-request label 2026-01-22 16:16:12 +01:00
admin closed this issue 2026-01-22 16:16:12 +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#13107