https://github.com/jdecool/phpstan-report
Enhance PHPStan analysis by providing report analysis
https://github.com/jdecool/phpstan-report
hacktoberfest
Last synced: about 1 year ago
JSON representation
Enhance PHPStan analysis by providing report analysis
- Host: GitHub
- URL: https://github.com/jdecool/phpstan-report
- Owner: jdecool
- License: mit
- Created: 2024-07-28T19:49:06.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-12T20:01:28.000Z (about 1 year ago)
- Last Synced: 2025-05-13T17:09:32.139Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 218 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PHPStan Report
==============
[](https://actions-badge.atrox.dev/jdecool/phpstan-report/goto?ref=main)
[](https://packagist.org/packages/jdecool/phpstan-report)
[](https://packagist.org/packages/jdecool/phpstan-report)
[](https://packagist.org/packages/jdecool/phpstan-report)
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:
```bash
composer require --dev jdecool/phpstan-report
```
## Usage
The main command provided by this package is `analyze`. Here's the basic usage:
```bash
$ 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, occurrence)
* `--report-exclude-identifier`: Identifier to exclude from the report (accepts multiple values)
* `--report-file-`: Export report in an output file for a particular format
* `--report-http-target-url`: The target URL to send the report to (available only if output format is `http`)
* `--report-http-add-header`: Add a header to the HTTP request (available only if output format is `http`)
Available formats are: `text`, `html`, `http`, `json` and `gitlab`.
For a full list of options, run:
```bash
$ php vendor/bin/phpstan-report analyze --help
```
## Examples
Run analysis and generate a text report:
```bash
$ php vendor/bin/phpstan-report analyze src tests
```
Generate an HTML report without running analysis:
```bash
$ php vendor/bin/phpstan-report analyze --report-without-analyze --report-output-format=html
```
Run analysis, continue on error, and save report to a file:
```bash
$ php vendor/bin/phpstan-report analyze --report-continue-on-error --report-file-json=report.json src
```