Skip to content

invalid native type detection with method_exists check combination #13414

@samsonasik

Description

@samsonasik

Bug report

when using method_exists combination, it seems cause invalid native type detection that include class-string

Dumped type: class-string|(object~SqlServerConnection&hasMethod(getSchemaState))

Code snippet that reproduces the problem

https://phpstan.org/r/c6ab65e4-0a0a-41de-86b8-5b64241f3470

Expected output

It should be only defined native type without class-string, as never defined like that, something like:

-Dumped type: class-string|(object~SqlServerConnection&hasMethod(getSchemaState))
+Dumped type: (object~SqlServerConnection&hasMethod(getSchemaState))

or just MixedType, since it not native returned defined in ConnectionResolverInterface

see linked rector issue:

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions