phpstan-src
phpstan-src copied to clipboard
Fixed incorrect return type of PDO::quote()
Fixes https://github.com/phpstan/phpstan/issues/10512
You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x.
Friendly ping @ondrejmirtes you might have missed this "easy" PR to review or do you also want a non-regression test for such changes ?
I didn't merge this yet because I'm not sure about this change.
The documentation states:
Returns false if the driver does not support quoting in this way.
So a benevolent union type might be the better choice here - __benevolent<string|false>.
Also the usage of this function at all is not recommended in favor of prepared statements.
That's why I didn't rush to merge this.