-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Precise EntityRepository::count return type #11579
Precise EntityRepository::count return type #11579
Conversation
The static analysis failures appear to be related to your changes. |
Sure, it's because
is not inferred as I have two ways to solve this.
I wanted to know if you preferred one. I went with the first one. @derrabus |
I think you picked the right solution, because the baseline is not made only of issues we deliberately want to ignore, but also of issues we might want to address someday ™️ Please kindly squash your commits together. If you don't, we'll try to remember to do it for you but it's best if you save us this trouble. Also, this should be targeted to 3.3.x. |
We could also |
cfd0886
to
e648396
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 once PHPCS is happy.
e648396
to
c54a271
Compare
Done |
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)