承接 peridot-php/peridot-code-coverage-reporters 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

peridot-php/peridot-code-coverage-reporters

最新稳定版本:3.0.0

Composer 安装命令:

composer require peridot-php/peridot-code-coverage-reporters

包简介

Code coverage reporters for Peridot PHP.

README 文档

README

Packagist Version Build Status Scrutinizer Code Quality Codecov Coverage Gitter Chat

Installation

Add this package as a dependency:

composer require --dev peridot-php/peridot-code-coverage-reporters 

Then register the reporters in your peridot.php configuration:

use Evenement\EventEmitterInterface; use Peridot\Reporter\CodeCoverage\CodeCoverageReporter; use Peridot\Reporter\CodeCoverageReporters; return function (EventEmitterInterface $emitter) { $coverage = new CodeCoverageReporters($emitter); $coverage->register(); $emitter->on('code-coverage.start', function (CodeCoverageReporter $reporter) { $reporter->addDirectoryToWhitelist(__DIR__ . '/src'); }); };

Usage

This package provides several Peridot reporters that can be used via the --reporter option:

  • html-code-coverage
  • text-code-coverage
  • clover-code-coverage
  • xml-code-coverage
  • crap4j-code-coverage
  • php-code-coverage

These reporters are all driven by php-code-coverage, which requires the use of either the phpdbg executable, or the xdebug PHP extension in order to produce coverage reports.

With phpdbg

Where available, phpdbg is generally recommended for faster coverage reporting. Most system-level package management tools should be able to install a version of phpdbg with minimal hassle. Under Homebrew, for example, phpdbg can be installed like so:

brew tap homebrew/homebrew-php && brew install php71 --with-phpdbg 

Once installed, phpdbg -qrr can be used in place of php when executing scripts, including the peridot binary, allowing code coverage to be generated:

phpdbr -qrr vendor/bin/peridot --reporter spec --reporter html-code-coverage 

The above command will print spec-style output while the suite runs, and generate an HTML coverage report once the suite has completed.

With xdebug

Use of xdebug is no longer recommended, because of the significantly worse performance compared to phpdbg. If phpdbg is not an option, simply make sure the xdebug extension is enabled when running peridot:

vendor/bin/peridot --reporter spec --reporter html-code-coverage 

The above command will print spec-style output while the suite runs, and generate an HTML coverage report once the suite has completed.

统计信息

  • 总下载量: 69.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 20
  • 推荐数: 1

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固