What problem does it solve?
This Skill helps WordPress developers configure, run, and fix PHPStan static analysis across plugins, themes, and sites by guiding setup like phpstan.neon, baselines, and WordPress-specific typing.
Core Features & Use Cases
- WordPress-focused configuration: Ensures WordPress stubs are loaded and the PHPStan config is tailored to WP environments.
- Baseline management: Generates and updates a PHPStan baseline to progressively reduce noise from legacy code.
- Third-party integration support: Provides guidance and stubs for common plugins (WooCommerce, ACF, etc.) to improve analysis accuracy.
- Use Case: A developer adds a new plugin and runs PHPStan to identify typing issues, then updates docblocks and stubs to resolve them.
Quick Start
Configure PHPStan for a WordPress project by running:
- Ensure dependencies are installed: composer install
- Run PHPStan via the project script (preferred): composer run phpstan
- If no script exists, run: vendor/bin/phpstan analyse -c phpstan.neon