Skip to content

PHPStan doesn't find the WP CLI stubs in scanFiles #8

@devbanana

Description

@devbanana

The readme says to include wp-cli-stubs.php (and the other files) under scanFiles. I have this:

parameters:
    scanFiles:
        - vendor/php-stubs/wp-cli-stubs/wp-cli-stubs.php
        - vendor/php-stubs/wp-cli-stubs/wp-cli-i18n-stubs.php
        - vendor/php-stubs/wp-cli-stubs/wp-cli-commands-stubs.php

But I have a class that extends WP_CLI_Command, and when analyzing that file I get:

Class WP_CLI_Command not found.

Only if I include it under bootstrapFiles does it work.

I'm not sure whether to report this on phpstan or here. Or if just something has changed not reflected in the documentation.

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