Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Changing return type of getSingleScalarResult() to array|bool|float|int|string|null#10695

Closed
ThomasLandauer wants to merge 1 commit into
doctrine:2.15.xfrom
ThomasLandauer:patch-1
Closed

Changing return type of getSingleScalarResult() to array|bool|float|int|string|null#10695
ThomasLandauer wants to merge 1 commit into
doctrine:2.15.xfrom
ThomasLandauer:patch-1

Conversation

@ThomasLandauer
Copy link
Copy Markdown
Contributor

Reason: I'm using intval() to sanitize the result of getSingleScalarResult(). But now, PHPStan 1.10.15 complains that intval() only accepts bool|float|int|resource|string|null as input: phpstan/phpstan#9295
So I threw all of these (except resource) in here :-)
I didn't doublecheck anything - waiting for some feedback first.

…t|int|string|null`

Reason: I'm using `intval()` to sanitize the result of `getSingleScalarResult()`. But now, PHPStan 1.10.15 complains that `intval()` only accepts `bool|float|int|resource|string|null` as input: phpstan/phpstan#9295
So I threw all of these (except `resource`) in here :-)
I didn't doublecheck anything - waiting for some feedback first.
@phansys
Copy link
Copy Markdown
Contributor

phansys commented May 23, 2023

I didn't find this PR before, so I've created #10721. Sorry for that.

I didn't doublecheck anything - waiting for some feedback first.

Based on n my tests, I can confirm this method can not return array or null.

@ThomasLandauer
Copy link
Copy Markdown
Contributor Author

Never mind - so I'm closing here :-)

@ThomasLandauer ThomasLandauer deleted the patch-1 branch May 12, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants