Skip to content

Incorrect return type for PDOStatement::errorCode() #12571

@dtdesign

Description

@dtdesign

Bug report

The return type of PDOStatement::errorCode() is ?string, but PHPStan recognizes it as just string.

Code snippet that reproduces the problem

https://phpstan.org/r/c1d28a38-1cea-4a0b-b431-d3ff597c7f04

Expected output

The non-null assertion should be passed to narrow down the value to just string.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions