What problem does it solve?
PHPStan can surface bugs and type issues in Sage/Acorn WordPress code early, but WordPress’s dynamic functions and hooks often require careful stubbing, ignore rules, and baseline management to make results actionable.
Core Features & Use Cases
- Sets up PHPStan for Sage/Acorn: Installs phpstan/phpstan, larastan/larastan, and szepeviktor/phpstan-wordpress for WordPress and Acorn compatibility.
- Creates and maintains a phpstan.neon configuration: Supports level selection (0–9), scanning paths, hook ignore patterns, and WordPress bootstrap scanning.
- Enables incremental adoption with baselines: Generates phpstan-baseline.neon so CI can fail on new errors while existing issues are handled gradually.
- Supports CI enforcement: Runs PHPStan with GitHub-style annotations and includes a baseline-growth prevention check.
Quick Start
Run the lando PHPStan analysis at level 0 by installing phpstan/larastan/WordPress stubs, writing a phpstan.neon that includes them, and then executing the initial analyze command to confirm you have a clean or manageable starting state.