Download the PHP package jbelien/phpstan-sarif-formatter without Composer
On this page you can find all versions of the php package jbelien/phpstan-sarif-formatter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jbelien/phpstan-sarif-formatter
More information about jbelien/phpstan-sarif-formatter
Files in jbelien/phpstan-sarif-formatter
Package phpstan-sarif-formatter
Short Description SARIF formatter for PHPStan
License MIT
Informations about the package phpstan-sarif-formatter
SARIF formatter for PHPStan
🔖 Compatible with PHPStan 1.x and 2.x
PHPStan
PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line.
Static Analysis Results Interchange Format (SARIF)
SARIF, the Static Analysis Results Interchange Format, is a standard, JSON-based format for the output of static analysis tool.
It has been approved as an OASIS standard.
SARIF is a rich format intended to meet the needs of sophisticated tools, while still being practical for use by simpler tools. Because it would be impractical to support every feature of every tool, SARIF provides an extensibility mechanism to allow tool authors to store custom data that the SARIF format doesn't directly represent.
https://docs.oasis-open.org/sarif/sarif/v2.0/sarif-v2.0.html
Usage
Then update your phpstan.neon
configuration file:
GitHub Code Scanning
GitHub Code Scanning features are compatible with SARIF.
The SARIF Formatter for PHPStan allows you to use PHPStan as GitHub Code Scanning tool.
To use in one of your GitHub Actions workflows, add the following in your job:
It will display PHPStan error messages in your PR (check this PR) and add alerts in the "Code scanning" report in "Security" tab of your project (see screenshot below).