Skip to content

Signature improperly read from PHPStorm stubs #7676

@hrach

Description

@hrach

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions