From Zero to Static Analysis Hero
summary
Claim: static analysis can catch the same runtime errors earlier by parsing code into an AST, traversing nodes, building a symbol repository and using PHPStan’s type system. Demonstration uses PHPStan level 5, implements a custom rule preventing unnecessary value() calls via node inspection, scope type checks and RuleErrorBuilder, runs across the repo and surfaces a real warning, and notes that Laran already supplies a more robust variant for Laravel projects.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:02What is static analysis
- 5:56Static analysis levels
- 9:55PHPStan for conformance
- 10:59How PHPStan works
- 14:51Custom PHPStan rule
- 28:41Extending PHPStan with Laravel
- 29:43Q&A
related talks
25mTypes & static analysis are good in PHP
53mStatic Analysis Saved My Code Tonight
38mWhy you should be using PHPStan in all your projects
50mPractical Advanced Static Analysis
57mExtending the PHP Language with Static Analysis- Dave Liddament
45mTesting Strategy with the Help of a Static Analyzer
55mSquash Bugs with Static Analysis
55mReview unknown code with static analysis
