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

Signature improperly read from PHPStorm stubs #7676

Closed
hrach opened this issue Jul 23, 2022 · 2 comments
Closed

Signature improperly read from PHPStorm stubs #7676

hrach opened this issue Jul 23, 2022 · 2 comments
Labels
Milestone

Comments

@hrach
Copy link
Contributor

hrach commented Jul 23, 2022

Bug report

Some functions (pgsql) converted from resource to object. However, the conditional typing is somehow broken for some functions. For me: pg_escape_literal and pg_escape_identifier, maybe others. I expect this is broken by some wrong type processing/evaluation, because the proper typing is present in PHPStorm stubs.

Code snippet that reproduces the problem

https://phpstan.org/r/11f31e1b-3464-4480-a43b-7a0b590b094a

$connection = pg_connect("", PGSQL_CONNECT_FORCE_NEW);
if ($connection === false) return;
pg_escape_literal($connection, "test");

Expected output

No error.

@ondrejmirtes
Copy link
Member

This has nothing to do with PhpStorm stubs, but with https://github.com/phpstan/php-8-stubs.

I broke this when I started extracting PHP 8.2 stubs.

This diff is wrong and I need to fix the extractor: phpstan/php-8-stubs@9189f49#diff-4f7efef92fb30a1f2d31e51e4fc1269eb15f90d362bc610d4d2af01ce38734f3L3-L7

@github-actions
Copy link

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 Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants