Introducing Larastan — Alpha

I just released the Alpha version of Larastan! Here is a presentation on how it works, the upcoming developments and improvements

The package is still under development and feedback is highly welcome. Please don’t ignore false positives, and report them using the issues tab of this project. 🙏
Check package’s github page here! 📦

General details

Larastan was created by, and is maintained by Nuno Maduro, and is a Phpstan wrapper for Laravel. Larastan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. The first alpha version supports most of Laravel's beautiful magic.

Installation & Usage

You may use Composer to install Larastan as a development dependency into your Laravel project:

composer require --dev nunomaduro/larastan

Once you have installed Larastan, you may start analyzing your code using the code:analyse artisan command.

php artisan code:analyse

Rule levels

You can choose from currently 8 levels: (0 is the loosest and 7 is the strictest). The default level is “5”. You can also use the level “max” as an alias for the highest level.

php artisan code:analyse --level=max

Paths

You can choose which directories you want to analyze, by default, the analysed directory will be the “app”.

php artisan code:analyse --paths="modules,app,domain"

Upcoming developments and improvements

  1. Keep covering Laravel’s magic the most as possible.
  2. Fix reports of false positives from the community’s feedback.
  3. Understand the type of tests is needed for this package: unit, acceptance, and integration tests?

Get involved

This is a community project, there are many opportunities to contribute to all the Larastan ecosystem.

Feel free to contact me on twitter: @enunomaduro.

Thanks, I hope you enjoy this new release! 🎉

If you found this article useful, please comment below and clap, if you like.