Everything on Static Analysis.
8 articles tagged Static Analysis, sorted newest first.
Write a Custom Rector Rule to Refactor Your Own Laravel Conventions
Rector gets used for framework upgrades and almost never for the thing it is best at — mechanically applying a decision your own team made. Here's the AST-first workflow, and the two mistakes that make a new rule silently do nothing.
Write a Custom PHPStan Rule to Enforce Your Laravel Conventions
Some conventions live only in reviewers' heads, so they rot. A PHPStan custom rule moves one of them into CI permanently — here is the whole build, including the test.
The #[\Override] Attribute: Catching Broken Laravel Inheritance at Compile Time
PHP 8.3's #[\Override] attribute converts a whole class of silent inheritance bugs into loud compile-time errors. Here's where it pays off in a real Laravel app — and the four places it will blow up in your face.
Measure and Enforce Type Coverage with Pest's Type Coverage Plugin
'We use types' is not a measurable claim. Pest's type coverage plugin turns it into a percentage you can read per file and enforce in CI.
Adopt a PHPStan Baseline on a Legacy Laravel App (and Burn It Down)
A first PHPStan run on an old Laravel app reports thousands of errors. Here's how to baseline that debt, hold new code to the full ruleset, and reduce it deliberately.
PestStan — Type-Safe Pest 4 Tests With PHPStan Generics in a Laravel App
PestStan teaches PHPStan about Pest's globals — generic expect() types, proper $this binding, and rules that catch broken assertions before the test even runs.
PHP 8.5 #[\NoDiscard]: Stop Silently Ignoring Return Values That Matter
PHP 8.5 ships a new #[\NoDiscard] attribute that warns when you forget to use a function's return value. Here is how to apply it to your own immutable builders — and why (void) is the only safe way to suppress it.
PHPStan Level 10 in Laravel: Fix the 5 Most Common Errors
Bumped Larastan to level 10 and got 300 new errors? Here are the five patterns you'll see again and again: and the exact fix for each.