wp-phpstan by automattic/agent-skills
npx skills add https://github.com/automattic/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,从较低级别开始,然后逐步提高每周安装次数
76
代码仓库
GitHub 星标数
188
首次出现
2026年1月21日
安全审计
安装于
opencode53
claude-code50
gemini-cli45
codex43
github-copilot40
cursor40
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
76
Repository
GitHub Stars
188
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode53
claude-code50
gemini-cli45
codex43
github-copilot40
cursor40
WordPress区块主题开发与调试指南:编辑theme.json、模板、模式与样式变体
938 周安装