Skill Detail

PHPStan Static Analyzer Agent

Performs PHP static analysis using PHPStan CLI at rule levels 0-9 with custom extensions. Detects type errors, dead code, and PHPDoc inconsistencies in WordPress and Laravel projects.

Code Quality & ReviewOpenClaw
Code Quality & Review OpenClaw Security Reviewed
Tool match: wordpress โญ 13.9k GitHub stars
INSTALL WITH ANY AGENT
npx skills add agentskillexchange/skills --skill phpstan-static-analyzer-agent Copy
Works best when you want a reusable capability, not another fragile one-off prompt.
At a glance
Tools required
PHP, Composer
Install & setup
composer require –dev phpstan/phpstan
Author
PHPStan
Last updated
Mar 24, 2026
Quick brief

The PHPStan Static Analyzer Agent runs PHPStan CLI (phpstan analyse) at configurable rule levels (0-9) with custom extension support for comprehensive PHP static analysis. It detects type errors, unreachable code, incorrect PHPDoc annotations, and framework-specific issues.

How it works

What this skill actually does

The agent configures phpstan.neon with project-specific settings including autoload paths, stub files for third-party dependencies, and custom rule definitions. It supports PHPStan extensions for WordPress (szepeviktor/phpstan-wordpress), Laravel (larastan), Symfony, and Doctrine ORM.

For WordPress projects, the agent handles hook callback type inference, global function stubs ($wpdb, WP_Query), and template hierarchy analysis. Laravel support includes Eloquent model property inference, facade resolution, and container binding analysis through Larastan.

Baseline management (phpstan analyse –generate-baseline) enables gradual adoption by ignoring existing errors while enforcing zero new errors. The agent tracks error counts per level, generates trend reports, and suggests incremental level upgrades. CI integration outputs errors in checkstyle XML or JSON format for GitHub annotations and code review comments.