Rules, Not Prompts: PHPStan and Coding Agents
summary
Agents generate PHP but safety and long‑term design require both human review and automated checks; PHPStan runs static analysis, prints per‑error identifiers and agent instructions, and supports rule levels (recommendation: aim for at least level five) and extras like linkage, shipmong dead code detector and conditional return types. Custom PHPStan rules enforce things like “no new Person except in PersonFactory,” are testable, and run against the codebase; agents can generate rules but human review finds edge cases and ensures fixes address root causes rather than silencing errors.
AI-written summary · about
chapters (11)
- 0:00Introduction and welcome
- 1:23Why review agent-generated code
- 5:54Tool review and PHPStan basics
- 7:04Understanding PHPStan rule levels
- 11:39Advanced PHPStan features
- 16:22PHPStan for coding agents
- 19:31Custom PHPStan rules motivation
- 21:04Writing custom PHPStan rules
- 26:48Testing and maintaining custom rules
- 28:21Generating rules with agents
- 30:45Q&A and closing remarks
related talks
45mAI-powered Code Development: The role of prompt engineering
30mOpen Challenges for Programming Agents
48mAgent-Agnostic Guardrails: Universal Java Code Quality with AGENTS.MD and Static Analysis
48mThe Best of Strong Typing in PHP
50mPanel: Beyond The Vibe: Code Quality First
24mFrom Prompts to AGENTS.md: What Survives Across Thousands of Runs
45mAI Assistance for Software Teams: The State of Play
48mStop Fighting Your AI Engineering Prompts That Actually Work
