2017 © Pedro Peláez
 

library phpstan-junit

PHPStan JUnit error reporter

image

mavimo/phpstan-junit

PHPStan JUnit error reporter

  • Wednesday, June 20, 2018
  • by mavimo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 62 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHPStan JUnit error reporter

License Coverage Status Codacy Badge, (*1)

Packagist Packagist Packagist Packagist, (*2)

The main scope for this project is to create error report in JUnit format that can be easly integrated in Jenkins or other tools that use this information., (*3)

DEPRECATION

Warning This project is not needed anymore since this feature is now built-in into PHPStan itself, (*4)

How to use it

Install

You need to include this library in your project as dev-dependency, it dependes on the version of phpstan you're using you should use a different version of mavimo/phpstan-junit library, this table will give you a dependency map:, (*5)

phpstan/phpstan version mavimo/phpstan-junit version
0.10.x 0.1.x
0.11.x 0.2.x
0.12.x 0.3.x

But if alredy specified the phpstan/phpstan version you can just use:, (*6)

composer require --dev mavimo/phpstan-junit

If you also install phpstan/extension-installer then you're all set, otherwise take a look to manual setup section below., (*7)

Manual setup for PHPStan 0.11 and next if you don't want to use phpstan/extension-installer, you should require the extension.neon file on your phpstan.neon.dist file in the root of your project (or on the file you specify to phpstan using the --config flag):
, (*8)

includes:
    - vendor/mavimo/phpstan-junit/extension.neon

or declaring the service via:, (*9)

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

, (*10)

Manual setup for PHPStan 0.10
You should require this extension on phpstan.neon file in the root of your project or the file you specify to phpstan using the --config flag by referencing extension.neon file:
, (*11)

includes:
    - vendor/mavimo/phpstan-junit/phpstan.neon

or declaring the service via:, (*12)

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

, (*13)

Generate JUnit report

You should gnerate JUnit report with the flag --error-format=junit, eg:, (*14)

vendor/bin/phpstan --error-format=junit --no-progress --no-interaction analyse src

Contributing

Contributions are welcome!, (*15)

PR's will be merged only if:, (*16)

  • phpunit is :white_check_mark:, you can run it using vendor/bin/phpunit
  • phpstan is :white_check_mark:, you can run it using vendor/bin/phpstan analyse
  • phpcs is :white_check_mark:, you can run it using vendor/bin/phpcs
  • code coverage will not decrease (or there are good reason to decrease it), you can check the current coverage using phpdbg -qrr ./vendor/bin/phpunit --coverage-text

If you have any question feel free to open a issue or contact me!, (*17)

The Versions

20/06 2018

dev-master

9999999-dev

PHPStan JUnit error reporter

  Sources   Download

MIT

The Requires

 

The Development Requires