📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials PHPUnit Testing PHPStan Static Analysis

PHPStan Static Analysis

5 min read
Run PHPStan at level 8 for strict type and null-safety analysis without executing the code.

Static Analysis

composer require --dev phpstan/phpstan

# phpstan.neon
parameters:
    level: 8
    paths:
        - src

./vendor/bin/phpstan analyse

# Level 0: Basic checks
# Level 5: Unknown variables, null safety
# Level 8: Generics, templates
# Level 9: Strictest