You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHPStan (1.6.2) incorrectly reports errors for pg_query() for PHP 8.1:
It does not seam to be aware that pg_query() expects a PgSql\Connection object as the first parameter and returns a PgSql\Result object as of PHP 8.1. I have checked the PHP 8 stubs at https://github.com/phpstan/php-8-stubs/blob/main/stubs/ext/pgsql/pg_query.php but cannot spot an issue there as those signatures include the correct PHP 8.1 derivative.
Code snippet that reproduces the problem
function test(): \PgSql\Result|false {
return \pg_query(\pg_connect(''), '');
}
Bug report
PHPStan (1.6.2) incorrectly reports errors for
pg_query()for PHP 8.1:It does not seam to be aware that
pg_query()expects aPgSql\Connectionobject as the first parameter and returns aPgSql\Resultobject as of PHP 8.1. I have checked the PHP 8 stubs at https://github.com/phpstan/php-8-stubs/blob/main/stubs/ext/pgsql/pg_query.php but cannot spot an issue there as those signatures include the correct PHP 8.1 derivative.Code snippet that reproduces the problem
https://phpstan.org/r/e6aba2b0-e06c-4e46-835a-a1b1fbe294d3
Expected output
No error messages