Package
Nunomaduro Larastan
Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel
Overview
What Nunomaduro Larastan does
Larastan is an extension for PHPStan tailored to enhance static analysis in Laravel projects, helping developers catch bugs before they write tests.
This tool stands out by marrying Laravel’s dynamic features with static typing, aiming to boost code quality and developer productivity. It transforms the traditional static analysis approach, making it suitable for Laravel by booting the application's container to resolve runtime-specific types, thus offering a more comprehensive analysis than standard static analysis tools.
Developers integrate Larastan into their workflow by installing it as a development dependency using Composer. Once set up, it requires the creation of a phpstan.neon configuration file, where specific analysis paths and levels are set. This facilitates starting the analysis process via the PHPStan console command, making it straightforward to incorporate into existing projects.
The package also provides flexibility for legacy codebases through the use of a baseline file. This feature allows teams to document current errors, enabling them to focus on maintaining high standards in new code without being bogged down by past issues. Within complex Laravel projects, Larastan helps spot errors that might otherwise only surface at runtime, offering a preventive measure in the coding process.
This overview was generated by AI from the package README and may not reflect the latest release.
Read the full README →