wp-phpstan by wordpress/agent-skills
npx skills add https://github.com/wordpress/agent-skills --skill wp-phpstan在 WordPress 代码库中处理 PHPStan 相关工作时使用此技能,例如:
phpstan.neon / phpstan.neon.distphpstan-baseline.neonwp-project-triage 的输出(如果尚未运行,请先运行)node skills/wp-phpstan/scripts/phpstan_inspect.mjs如果仓库已存在 composer 脚本(例如 ),请优先使用。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
composer run phpstan对于大多数 WordPress 插件/主题仓库,实际上都需要 szepeviktor/phpstan-wordpress 或 php-stubs/wordpress-stubs。如果没有它,将会出现大量关于未知 WordPress 核心函数的错误。
composer.dependencies)。references/third-party-classes.md)。phpstan.neonpaths 专注于第一方代码(插件/主题目录)。vendor/、node_modules/、构建产物、除非明确分析否则排除测试代码)。ignoreErrors 条目范围狭窄且有文档说明。参见:
references/configuration.md优先修正类型,而不是忽略错误。需要帮助的常见 WP 模式:
WP_REST_Request<...> 对请求参数进行类型标注@param 类型$args 数组进行形状类型标注参见:
references/wordpress-annotations.md当与分析环境中不存在的插件/主题集成时:
php-stubs/woocommerce-stubs、php-stubs/acf-pro-stubs)。ignoreErrors 模式。参见:
references/third-party-classes.md参见:
references/configuration.mdcomposer run ... 或 vendor/bin/phpstan analyse)。ignoreErrors 后重新运行,以确保模式没有掩盖不相关的问题。paths,添加 excludePaths,从较低级别开始,然后逐步提高每周安装次数
382
代码仓库
GitHub 星标数
985
首次出现
2026年2月1日
安全审计
安装于
codex278
opencode274
gemini-cli267
cursor264
github-copilot263
kimi-cli252
Use this skill when working on PHPStan in a WordPress codebase, for example:
phpstan.neon / phpstan.neon.distphpstan-baseline.neonwp-project-triage output (run first if you haven't)node skills/wp-phpstan/scripts/phpstan_inspect.mjsPrefer the repo’s existing composer script (e.g. composer run phpstan) when present.
szepeviktor/phpstan-wordpress or php-stubs/wordpress-stubs are effectively required for most WordPress plugin/theme repos. Without it, expect a high volume of errors about unknown WordPress core functions.
composer.dependencies in the inspect report).references/third-party-classes.md).phpstan.neon for WordPress projectspaths focused on first-party code (plugin/theme directories).vendor/, node_modules/, build artifacts, tests unless explicitly analyzed).ignoreErrors entries narrow and documented.See:
references/configuration.mdPrefer correcting types over ignoring errors. Common WP patterns that need help:
WP_REST_Request<...>@param types for callback args$args array shapes for job callbacksSee:
references/wordpress-annotations.mdWhen integrating with plugins/themes not present in the analysis environment:
php-stubs/woocommerce-stubs, php-stubs/acf-pro-stubs).ignoreErrors patterns for the specific vendor prefix.See:
references/third-party-classes.mdSee:
references/configuration.mdcomposer run ... or vendor/bin/phpstan analyse).ignoreErrors to ensure patterns are not masking unrelated issues.paths, add excludePaths, start at a lower level, then ratchet upWeekly Installs
382
Repository
GitHub Stars
985
First Seen
Feb 1, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex278
opencode274
gemini-cli267
cursor264
github-copilot263
kimi-cli252
xdrop 文件传输脚本:Bun 环境下安全上传下载工具,支持加密分享
20,700 周安装