jdecool / phpstan-report
Enhance PHPStan analysis by providing report analysis
Installs: 4 056
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 2
Type:project
Requires
- php: ^8.1
- monolog/monolog: ^2.0 || ^3.0
- phpstan/phpstan: ^1.11
- psr/log: ^2.0 || ^3.0
- symfony/config: ^5.4 || ^6.0 || ^7.1
- symfony/console: ^5.4 || ^6.0 || ^7.1
- symfony/dependency-injection: ^5.4 || ^6.0 || ^7.1
- symfony/filesystem: ^5.4 || ^6.0 || ^7.1
- symfony/finder: ^5.4 || ^6.0 || ^7.1
- symfony/polyfill-intl-icu: ^1.31
Requires (Dev)
- ergebnis/composer-normalize: ^2.43
- phpunit/phpunit: ^10.5
- symfony/var-dumper: ^5.4 || ^6.0 || ^7.1
README
A simple wrapper around PHPStan to extends PHPStan's functionality by providing a customizable report generation feature. It allows you to run PHPStan analysis and generate reports on ignored errors in various formats.
Installation
You can install the package via composer:
composer require --dev jdecool/phpstan-report
Usage
The main command provided by this package is analyze
. Here's the basic usage:
$ php vendor/bin/phpstan-report analyze
Options
--report-output-format
: Specify the output format for the report--report-without-analyze
: Generate a report without running the PHPStan analysis--report-continue-on-error
: Continue report generation even if the analysis fails--report-maximum-allowed-errors
: Set the maximum number of allowed errors--report-sort-by
: Sort the report results (options: identifier, counter)--report-exclude-identifier
: Identifier to exclude from the report (accepts multiple values)--report-file-<format>
: Export report in an output file for a particular format
Available formats are: text
, html
, json
and gitlab
.
For a full list of options, run:
$ php vendor/bin/phpstan-report analyze --help
Examples
Run analysis and generate a text report:
$ php vendor/bin/phpstan-report analyze src tests
Generate an HTML report without running analysis:
$ php vendor/bin/phpstan-report analyze --report-without-analyze --report-output-format=html
Run analysis, continue on error, and save report to a file:
$ php vendor/bin/phpstan-report analyze --report-continue-on-error --report-file-json=report.json src