php-stubs / wp-cli-stubs

WP-CLI function and class declaration stubs for static analysis.
https://packagist.org/packages/php-stubs/wp-cli-stubs
MIT License
23 stars 2 forks source link

Does not Find Bar and other Utils classes #12

Closed tomjn closed 1 year ago

tomjn commented 1 year ago

It does not find WP CLI Utils classes, giving reports such as this:

Call to method finish() on an unknown class WP_CLI\Utils\cli\progress\Bar. 
Call to method finish() on an unknown class WP_CLI\Utils\NoOp.
Call to method tick() on an unknown class WP_CLI\Utils\cli\progress\Bar.

etc

WP_CLI\Utils itself is stubbed, but not the classes underneath it

szepeviktor commented 1 year ago

Hello Tom! 👋🏻 Thank you for your report.

Have you tried using the other two stubs? There are three of them.

szepeviktor commented 1 year ago

No!! I know these errors. These are docblock errors in WP-CLI.

szepeviktor commented 1 year ago

... and it is fixed in https://github.com/wp-cli/wp-cli/pull/5715 but released yet

szepeviktor commented 1 year ago

You can patch the stubs temporarily. https://github.com/wp-cli/wp-cli/commit/da64a994c73379d7388ab9c766a0c4690cd0d6b7.patch e.g. using sed command