Skip to content

Instantly share code, notes, and snippets.

@leMaur
Created April 6, 2025 14:24
Show Gist options
  • Select an option

  • Save leMaur/88373c11921b9cffc006ab15e926cb5f to your computer and use it in GitHub Desktop.

Select an option

Save leMaur/88373c11921b9cffc006ab15e926cb5f to your computer and use it in GitHub Desktop.
Larastan
includes:
- vendor/larastan/larastan/extension.neon
# - vendor/nesbot/carbon/extension.neon
parameters:
level: 5
paths:
- app
- bootstrap
scanFiles:
# - _ide_helper.php
# - _ide_helper_models.php
excludePaths:
- app/Providers
reportMaybesInPropertyPhpDocTypes: false
treatPhpDocTypesAsCertain: false
noEnvCallsOutsideOfConfig: true
checkOctaneCompatibility: true
checkModelProperties: true
checkModelAppends: true
checkUnusedViews: false
@leMaur
Copy link
Author

leMaur commented Apr 6, 2025

Instructions

Install Laravel Pint

composer require --dev larastan/larastan

Copy this file into your project

cp https://gist.githubusercontent.com/leMaur/88373c11921b9cffc006ab15e926cb5f/raw/816a51beacc4061109fb8c6ff64f943fc9aa1bc0/phpstan.neon phpstan.neon

Add script in Composer.json

"analyze": [
    "vendor/bin/phpstan analyse --memory-limit=2G --ansi"
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment