Skip to content

Include wp-includes/compat.php #100

@swissspidy

Description

@swissspidy

Right now compat functions WordPress ships with, such as str_contains, are excluded from the stubs.

That means when a project's PHP version is < 8.0, PHPStan thinks the function does not exist and will report an error, even though WP actually provides this compat version

I can of course simply ignore the error in my config, but in my quick testing it seems like it should possible to include wp-includes/compat.php in the stubs, so that PHPStan will pick them up— as long as they are all still wrapped in function_exists() checks

Previously/related: #20 (though readonly is special because it's a syntax clash

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