Skip to content
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

Reflection error: Could not locate constant PDO::FETCH_DEFAULT #6255

Closed
ThibaudDauce opened this issue Dec 30, 2021 · 5 comments
Closed

Reflection error: Could not locate constant PDO::FETCH_DEFAULT #6255

ThibaudDauce opened this issue Dec 30, 2021 · 5 comments

Comments

@ThibaudDauce
Copy link

ThibaudDauce commented Dec 30, 2021

Bug report

When using PDO::pgsqlGetNotify in PHP 8.0 I have a problem with the PHPStorm stub (PDO::FETCH_DEFAULT seems missing or incorrect). I didn't test on PHP 8.1 but it seems to require 2 parameters (which seems wrong looking at the documentation https://www.php.net/manual/fr/pdo.pgsqlgetnotify.php). This is a new error (I encounter it after updating from 1.0 to 1.3)

Code snippet that reproduces the problem

https://phpstan.org/r/ba95c388-420a-4e8f-9dd0-b4d3d4a83a24

Did PHPStan help you today? Did it make you happy in any way?

PHPStan is getting smarter everyday and it's a good thing for PHP!

@staabm
Copy link
Contributor

staabm commented Dec 30, 2021

Your repro snippet does not use PDO::FETCH_DEFAULT ?

@ThibaudDauce
Copy link
Author

@staabm Yes, that's why I think it's a PHPStan bug and not a problem in my code :-) I think there is a problem inside phar:///var/task/vendor/phpstan/phpstan/phpstan.phar/vendor/jetbrains/phpstorm-stubs/PDO/PDO.stub

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@3624bbb

@ThibaudDauce
Copy link
Author

Thanks a lot for the quick fix!

@github-actions
Copy link

github-actions bot commented Feb 5, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants