-
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
Fix return type of getSingleScalarResult
#10870
Fix return type of getSingleScalarResult
#10870
Conversation
That's not quite correct as Please see screenshot: How to reproduce:
|
You're right. Please send a PR to add back the |
Shall I add back only I can't make I'd suggest to revert this PR altogether unless @whatUwant can provide a test case for returning |
It's correct that
|
|
You are totally right 👍 |
Fix regression introduced in #10870 `$result = $this->execute(null, $hydrationMode);` in `getSingleResult` can still throw NoResultException exception.
Doctrine\ORM\AbstractQuery::getSingleScalarResult()
does not havenull
as a possible type of returned data whileNoResultException
is listed as one of the possible exceptions thrown.However
NoResultException
is thrown only when hydration mode is notHYDRATE_SINGLE_SCALAR
.In
getSingleScalarResult
hydration mode was set toHYDRATE_SINGLE_SCALAR
viaDoctrine\ORM\AbstractQuery::execute()
which makes it impossible to throw that particular type of exception.