About Larastan

Larastan was created by, and is maintained by Nuno Maduro, and is a phpstan/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.

Rule levels

You can choose from currently 8 levels: (0 is the loosest and 7 is the strictest) by passing --level to analyse command. Default level is 5. You can also use --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 analyzed directory will be the app.

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

Error formats

By default, Larastan outputs found errors into tables grouped by files to be easily human-readable. To change the output, you can use the --error-format CLI option.

The available options are: checkstyle, raw, table, json, prettyJson.

php artisan code:analyse --error-format table

Contributing

Thank you for considering to contribute to Larastan. All the contribution guidelines are mentioned here.

You can have a look at the CHANGELOG for constant updates & detailed information about the changes. You can also follow the Twitter account for latest announcements or just come say hi!: @enunomaduro.