定制 mavimo/phpstan-junit 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mavimo/phpstan-junit

最新稳定版本:0.3.0

Composer 安装命令:

composer require mavimo/phpstan-junit

包简介

PHPStan JUnit error reporter

README 文档

README

License Coverage Status Codacy Badge

Packagist Packagist Packagist Packagist

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.

DEPRECATION

Warning This project is not needed anymore since this feature is now built-in into PHPStan itself

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:

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:

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.

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):
includes:
    - vendor/mavimo/phpstan-junit/extension.neon

or declaring the service via:

services:
    errorFormatter.junit:
        class: Mavimo\PHPStan\ErrorFormatter\JunitErrorFormatter
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:
includes:
    - vendor/mavimo/phpstan-junit/phpstan.neon

or declaring the service via:

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

Generate JUnit report

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

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

Contributing

Contributions are welcome!

PR's will be merged only if:

  • phpunit is ✅, you can run it using vendor/bin/phpunit
  • phpstan is ✅, you can run it using vendor/bin/phpstan analyse
  • phpcs is ✅, 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!

统计信息

  • 总下载量: 321.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 13
  • 点击次数: 0
  • 依赖项目数: 8
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 2
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-08