Larastan
Static analysis that finds bugs without running the code.
Static analysis is the practice of examining code without running it, looking for problems: using a variable before it's defined, calling a method that doesn't exist, returning the wrong type from a function, passing incorrect arguments. These are bugs that might not surface immediately in tests but would cause errors in production.
Larastan is a static analysis tool specifically built for Laravel applications. It understands Laravel's patterns — Eloquent models, Facades, service containers — and applies rigorous type checking across the entire codebase.
Think of it as a very thorough code review that runs automatically. It catches a class of bugs that tests often miss, particularly around incorrect assumptions about types and shapes of data.
Type errors, undefined methods, impossible code paths — Larastan finds these at analysis time, not when a user triggers the error in production.
When renaming a method or changing a return type, Larastan immediately shows every call site that needs updating. Large refactors become significantly less risky.
The discipline of writing code that passes strict type analysis leads to cleaner, more explicit code that's easier to maintain.
Larastan runs automatically in the CI pipeline alongside tests. Code with type errors doesn't ship.