rquadling/phpstan-junit

PHPStan JUnit error reporter

Installs: 32 051

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 11

Open Issues: 0

Type:phpstan-extension

v0.4.4 2021-11-11 19:08 UTC

This package is auto-updated.

Last update: 2024-04-12 00:33:25 UTC


README

Build Status Code Coverage GitHub issues

PHP Version Stable Version

Total Downloads Monthly Downloads Daily Downloads

DISCLAIMER

The code in this library is heavily (and I mean VERY VERY heavily) based upon the work in mavimo/phpstan-junit. I cannot stress strongly enough how much the work there is here. It is pretty much a direct rip off!

The main purpose of this fork is to allow the JUnit error reporter to operate on PHP 7.0 with the phpstan/phpstan-shim:0.9.2, as that is my current use case.

Scope

The main scope for this project is to create error report in JUnit format that can be easily integrated in Jenkins or other tools that use this information.

How to use it

Install

You need to include this library in your project as dev-dependency.

composer require --dev rquadling/phpstan-junit

You will need to add the appropriate service entry to your phpstan.neon file in the root of your project:

services:
    errorFormatter.junit:
        class: RQuadling\PHPStan\ErrorFormatter\JunitErrorFormatter

Generate JUnit report

You can generate JUnit reports using --errorFormat junit, eg:

vendor/bin/phpstan --configuration phpstan.neon --errorFormat junit --level max --no-progress --no-interaction analyse SOURCE_CODE_DIR

Contributing

Contributions are welcome, but this particular fork will not be needed for anything other than PHP 7.0 with PHPStan-shim v0.9.2. If you do have any contributions, then I'll certainly look at them. But if it is for any version different to the ones mentioned, then it is probably best you look at Mavimo's version.