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

0.8.0 2024-11-02 14:20 UTC

This package is auto-updated.

Last update: 2024-12-08 12:22:17 UTC


README

Build Status License Latest Stable Version Latest Unstable Version

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