shipmonk / phpstan-baseline-per-identifier
Error formatter for PHPStan that generates baseline files per each error identifier
Installs: 169
Dependents: 0
Suggesters: 0
Security: 0
Stars: 27
Watchers: 2
Forks: 0
Open Issues: 0
Type:phpstan-extension
Requires
- php: ^8.0
- nette/neon: ^3.3.3 || ^4.0
- phpstan/phpstan: ^1.11.5
Requires (Dev)
- editorconfig-checker/editorconfig-checker: 10.6.0
- ergebnis/composer-normalize: 2.43.0
- phpstan/phpstan-phpunit: 1.4.0
- phpstan/phpstan-strict-rules: 1.6.0
- phpunit/phpunit: 9.6.20
- shipmonk/composer-dependency-analyser: 1.7
- shipmonk/name-collision-detector: 2.1.1
- shipmonk/phpstan-rules: 3.1.0
- slevomat/coding-standard: 8.15.0
This package is auto-updated.
Last update: 2024-11-06 09:27:02 UTC
README
Split your PHPStan baseline into multiple files, one per error identifier:
baselines/ ├─ loader.neon ├─ empty.notAllowed.neon ├─ foreach.nonIterable.neon ├─ identical.alwaysFalse.neon └─ if.condNotBoolean.neon
Each file looks like this:
# total 1 error parameters: ignoreErrors: - message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#' path: ../app/index.php count: 1
Installation:
composer require --dev shipmonk/phpstan-baseline-per-identifier
Use official extension-installer or just load the extension:
includes: - vendor/shipmonk/phpstan-baseline-per-identifier/extension.neon
Usage:
Setup where your baseline files should be stored and include its loader:
# phpstan.neon.dist includes: - baselines/loader.neon parameters: shipmonkBaselinePerIdentifier: directory: %currentWorkingDirectory%/baselines indent: ' '
Prepare composer script to simplify generation:
{ "scripts": { "generate:baseline:phpstan": [ "rm baselines/*.neon", "touch baselines/loader.neon", "@phpstan analyse --error-format baselinePerIdentifier" ] } }
Regenerate the baselines:
composer generate:baseline:phpstan