mirror of
https://gh.wpcy.net/https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2026-05-04 14:29:01 +08:00
modified: composer.lock modified: mu-plugin/v-sys-plugin-updater-mu.php modified: mu-plugin/v-sys-plugin-updater.php modified: mu-plugin/v-sys-theme-updater-mu.php modified: mu-plugin/v-sys-theme-updater.php modified: tests/ApiKeyHelperTest.php modified: update-api/app/Controllers/ApiController.php modified: update-api/app/Controllers/HomeController.php deleted: update-api/app/Controllers/KeyController.php modified: update-api/app/Core/Router.php modified: update-api/app/Models/HostsModel.php modified: update-api/config.php modified: update-api/public/install.php deleted: update-api/storage/test.sqlite
36 lines
1.3 KiB
Markdown
36 lines
1.3 KiB
Markdown
# WP-CLI Stubs
|
|
|
|
[](https://app.travis-ci.com/php-stubs/wp-cli-stubs)
|
|
|
|
This package provides stub declarations for [WP-CLI](https://wp-cli.org/) functions, classes and interfaces.
|
|
These stubs can help plugin and theme developers leverage static analysis tools like [PHPStan](https://github.com/phpstan/phpstan), which are unable to parse WP-CLI as it is not clean OOP code.
|
|
|
|
Stubs are generated directly from the [source](https://wp-cli.org/) using [giacocorsiglia/stubs-generator](https://github.com/GiacoCorsiglia/php-stubs-generator).
|
|
|
|
### Requirements
|
|
|
|
- PHP >=7.1
|
|
|
|
### Installation
|
|
|
|
Require this package as a development dependency with [Composer](https://getcomposer.org).
|
|
|
|
```bash
|
|
composer require --dev php-stubs/wp-cli-stubs
|
|
```
|
|
|
|
Alternatively you may download `wp-cli-stubs.php` directly.
|
|
|
|
### Usage in PHPStan
|
|
|
|
Include all stubs in PHPStan configuration file.
|
|
|
|
```neon
|
|
parameters:
|
|
scanFiles:
|
|
- %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
|
|
- %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-stubs.php
|
|
- %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-commands-stubs.php
|
|
- %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-i18n-stubs.php
|
|
- %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-tools-stubs.php
|
|
```
|