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 havenullas a possible type of returned data whileNoResultExceptionis listed as one of the possible exceptions thrown.However
NoResultExceptionis thrown only when hydration mode is notHYDRATE_SINGLE_SCALAR.In
getSingleScalarResulthydration mode was set toHYDRATE_SINGLE_SCALARviaDoctrine\ORM\AbstractQuery::execute()which makes it impossible to throw that particular type of exception.