Skip to content

Call to private method sqliteCreateFunction() of parent class PDO #3527

@morozov

Description

@morozov

Bug report

PHPStan 0.12.30 falsely assumes that the PDO::sqliteCreateFunction() method is private. The same is not reproducible with PHPStan 0.12.18.

Doctrine DBAL uses PHPStan combined with JetBrains/phpstorm-stubs. Neither the internal PHPStan stubs, nor the ones from JetBrains declare this method as private.

Despite the fact that the pdo_sqlite extension is loaded at runtime, the method in question doesn't get exposed via the runtime reflection (see bug #78126):

$ php --rf 'PDO::sqliteCreateFunction'
Exception: Method PDO::sqliteCreateFunction() does not exist

Code snippet that reproduces the problem

https://github.com/doctrine/dbal/pull/4099/checks?check_run_id=797199560

I cannot reproduce this issue in the playground but it's reproducible locally and on CI. Please see morozov/dbal#phpstan-sqlite-create-function-private.

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