talira

Larastan

Adds code analysis to Laravel, improving developer productivity and code quality

open sourceMITfree

Larastan is a PHPStan extension for Laravel that finds errors in Laravel code without running it, catching whole classes of bugs before you write tests. It adds static typing to Laravel apps and supports most of Laravel's magic, and unlike plain static analysis it boots the application to resolve what Laravel only knows at runtime. It was created by Can Vural and Nuno Maduro.

Problems it solves

  • find bugs in my Laravel app before running it
  • make PHPStan understand Laravel facades and Eloquent models
  • add static type checking to a Laravel project

Features

  • PHPStan extension for Laravel apps
  • supports most of Laravel's magic
  • finds bugs before tests are written

Alternatives

The same job

These do what Larastan does.

  1. Psalm Laravel plugin Laravel static analysis and taint-based security scanning for Psalm
  2. PHPStan PHP static analysis that finds bugs without running your code
  3. TypeScript JavaScript with static types, compiled to plain JavaScript
  4. Flow A static type checker and typed dialect of JavaScript
  5. Steep Gradual typing for Ruby

Compare Larastan with the top 3