https://github.com/sanderdlm/phpstan-demo
A demo repository with easy to understand errors for each PHPStan level.
https://github.com/sanderdlm/phpstan-demo
Last synced: over 1 year ago
JSON representation
A demo repository with easy to understand errors for each PHPStan level.
- Host: GitHub
- URL: https://github.com/sanderdlm/phpstan-demo
- Owner: sanderdlm
- Created: 2023-07-10T15:36:33.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-10T18:02:36.000Z (about 3 years ago)
- Last Synced: 2025-03-29T10:34:09.832Z (over 1 year ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHPStan demo
This repository contains short, easy-to-understand examples of all errors that PHPStan reports, grouped per level.
It can be used to gradually introduce people or teams to what PHPStan has to offer.
## Basic usage
Each file in /src holds a few lines of PHP code that will trigger the exact errors PHPStan complains about at that level.
Run PHPStan with:
```
./vendor/bin/phpstan analyze src/ --level=0
```
Change the level and see the errors from each of the demo files.
## Composer script
```
composer analyze
```
Hardcoded at level 0 in `composer.json` under `scripts`.
## With config file
```
./vendor/bin/phpstan
```
Hardcoded at level 9 in `phpstan.neon.dist` under `parameters`.