pedro-mendonca / glotpress-stubs
为静态分析提供的 GlotPress 函数和类声明占位符。
4.0.1
2024-09-25 23:59 UTC
Requires (Dev)
- php: ^7.2
- ergebnis/composer-normalize: ^2.43.0
- php-stubs/generator: ^0.8.4
- php-stubs/wordpress-stubs: ^6.6.0
- dev-main
- 4.0.1
- 4.0.0
- 4.0.0-rc.1
- 4.0.0-beta.3
- 4.0.0-beta.2
- 4.0.0-beta.1
- 4.0.0-alpha.11
- 4.0.0-alpha.10
- 4.0.0-alpha.9
- 4.0.0-alpha.8
- 4.0.0-alpha.7
- 4.0.0-alpha.6
- 4.0.0-alpha.5
- 4.0.0-alpha.4
- 4.0.0-alpha.3
- 4.0.0-alpha.2
- 4.0.0-alpha.1
- 3.0.0
- 3.0.0-rc.4
- 3.0.0-rc.3
- 3.0.0-rc.2
- 3.0.0-rc.1
- 3.0.0-beta.1
- 3.0.0-alpha.4
- 3.0.0-alpha.3
- 3.0.0-alpha.2
- 3.0.0-alpha.1
- 2.3.1
This package is auto-updated.
Last update: 2024-09-26 00:00:12 UTC
README
为静态分析提供的 GlotPress 函数和类声明占位符。
本包提供了 GlotPress 函数、类和接口的占位符声明。
这些占位符可以帮助插件和主题开发者利用静态分析工具,如 PHPStan,这些工具无法解析 GlotPress,因为它不是干净的 OOP 代码。
占位符直接从 源代码 使用 php-stubs/generator 生成。
需求
- PHP >=7.2
安装
使用 Composer 将此包作为开发依赖项。
composer require --dev pedro-mendonca/glotpress-stubs
或者您可以直接下载 glotpress-stubs.php
。
在 PHPStan 中的使用
在 PHPStan 配置文件中包含所有占位符。
如果您已经使用 WordPress 扩展,可以移除 # WordPress Stubs
行。
parameters: scanFiles: # WordPress Stubs - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php # GlotPress Stubs - %rootDir%/../../pedro-mendonca/glotpress-stubs/glotpress-stubs.php