Change GetSingleScalarResult phpDoc to return string|null #6439

Closed
opened 2026-01-22 15:33:19 +01:00 by admin · 0 comments
Owner

Originally created by @VincentLanglet on GitHub (Apr 8, 2020).

Feature Request

Summary

When using getSingleScalarResult is a COUNT in my query, I always thought this would return an int, but I recently discovered it return a string instead.

I checked:

  • int are return as string.
  • bool are return as '0' or '1'.
  • null is return as null.
  • object are return with __toString.

Am I missing something or the GetSingleScalarResult phpDoc could be improved to return string|null ?

Originally created by @VincentLanglet on GitHub (Apr 8, 2020). ### Feature Request #### Summary When using `getSingleScalarResult` is a `COUNT` in my query, I always thought this would return an `int`, but I recently discovered it return a `string` instead. I checked: - int are return as string. - bool are return as '0' or '1'. - null is return as null. - object are return with __toString. Am I missing something or the `GetSingleScalarResult` phpDoc could be improved to `return string|null` ?
admin closed this issue 2026-01-22 15:33:19 +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#6439