Installation Steps
- Install PHPStan and Larastan via Composer:
composer require --dev phpstan/phpstan larastan/larastan
Configuration Steps
- Create
phpstan.neonfile in project root:- Location:
phpstan.neonorphpstan.dist.neon(root directory)
includes: - ./vendor/larastan/larastan/extension.neon parameters: level: 5 paths: - app - Location:
- Run PHPStan analysis:
./vendor/bin/phpstan analyse - Add to
composer.jsonscripts section:- Location:
composer.json(scripts section)
"scripts": { "analyse": "./vendor/bin/phpstan analyse" } - Location:
- Verify configuration is committed to version control
- Check:
phpstan.neonshould be in repository
- Check: