php-stubs/wp-cli-stubs
最新稳定版本:v2.12.0
Composer 安装命令:
composer require --dev php-stubs/wp-cli-stubs
包简介
WP-CLI function and class declaration stubs for static analysis.
README 文档
README
This package provides stub declarations for WP-CLI functions, classes and interfaces. These stubs can help plugin and theme developers leverage static analysis tools like PHPStan, which are unable to parse WP-CLI as it is not clean OOP code.
Stubs are generated directly from the source using giacocorsiglia/stubs-generator.
Requirements
- PHP >=7.1
Installation
Require this package as a development dependency with Composer.
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.
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
统计信息
- 总下载量: 1.93M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 28
- 点击次数: 2
- 依赖项目数: 64
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04