PHPackages                             turkeryildirim/phpunit-json-coverage-report - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. turkeryildirim/phpunit-json-coverage-report

ActiveLibrary[Testing &amp; Quality](/categories/testing)

turkeryildirim/phpunit-json-coverage-report
===========================================

Comprehensive JSON coverage reporter for PHPUnit.

v1.0.1(3mo ago)113MITPHPPHP ^8.1CI failing

Since Apr 8Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/turkeryildirim/phpunit-json-coverage-report)[ Packagist](https://packagist.org/packages/turkeryildirim/phpunit-json-coverage-report)[ RSS](/packages/turkeryildirim-phpunit-json-coverage-report/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

PHPUnit JSON Coverage Report
============================

[](#phpunit-json-coverage-report)

Comprehensive JSON coverage reporter for PHPUnit. Reports all 5 coverage metrics: **Line**, **Branch**, **Path**, **Function**, and **Class**.

Why this package exists
-----------------------

[](#why-this-package-exists)

`PHPUnit` provides code coverage data via `php-code-coverage`, but it does not offer a native JSON output format.

Existing formats such as HTML, Clover XML, or Cobertura XML are designed for human reading or specific CI tools. They are not convenient for programmatic consumption.

This package fills that gap by exposing coverage data as structured JSON.

---

Background
----------

[](#background)

There has been prior discussion about adding JSON output support directly to php-code-coverage:

[sebastianbergmann/php-code-coverage#829](https://github.com/sebastianbergmann/php-code-coverage/issues/829)

As of now, JSON output is not available natively. This package provides an external solution.

How it works
------------

[](#how-it-works)

This library is implemented as a PHPUnit extension.
It accesses the raw coverage data during runtime and serializes it into JSON.

- No XML parsing
- No post-processing required
- Direct access to in-memory coverage data

---

Use Cases
---------

[](#use-cases)

- CI pipelines (custom coverage checks)
- Programmatic analysis (scripts, tooling)
- Frontend dashboards
- Integration with other systems

Supported Versions
------------------

[](#supported-versions)

PHPUnitphp-code-coverageStatus10.x10.x✅ Tested11.x11.x✅ Tested12.x12.x✅ Tested13.x13.x✅ Tested> See [Version Compatibility](docs/VERSION_COMPATIBILITY.md) for detailed test results.

Installation
------------

[](#installation)

```
composer require --dev turkeryildirim/phpunit-json-coverage-report
```

Configuration
-------------

[](#configuration)

Add the reporter to your `phpunit.xml`:

```

```

Run tests with coverage:

```
vendor/bin/phpunit
```

A `coverage.json` file will be generated in your project root.

Documentation
-------------

[](#documentation)

- [Extended README](docs/README.md) - Detailed usage, output format, and all metrics explained
- [Contributing Guide](docs/CONTRIBUTING.md) - For developers who want to fork and extend
- [Version Compatibility](docs/VERSION_COMPATIBILITY.md) - Tested version combinations
- [Example Output](examples/coverage-sample.json) - Sample JSON output

License
-------

[](#license)

MIT License - see [LICENSE](LICENSE) for details.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance80

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

107d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5302904?v=4)[Türker YILDIRIM](/maintainers/turkeryildirim)[@turkeryildirim](https://github.com/turkeryildirim)

---

Top Contributors

[![turkeryildirim](https://avatars.githubusercontent.com/u/5302904?v=4)](https://github.com/turkeryildirim "turkeryildirim (5 commits)")

---

Tags

phpjsoncoveragecode coveragereporterphpuint

### Embed Badge

![Health badge](/badges/turkeryildirim-phpunit-json-coverage-report/health.svg)

```
[![Health](https://phpackages.com/badges/turkeryildirim-phpunit-json-coverage-report/health.svg)](https://phpackages.com/packages/turkeryildirim-phpunit-json-coverage-report)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k136.1M1.0k](/packages/brianium-paratest)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

623.9M56](/packages/dvdoug-behat-code-coverage)[friends-of-phpspec/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

212.7M131](/packages/friends-of-phpspec-phpspec-code-coverage)[leanphp/behat-code-coverage

Generate Code Coverage reports for Behat tests

51361.4k2](/packages/leanphp-behat-code-coverage)[robiningelbrecht/phpunit-coverage-tools

PHPUnit coverage tools

17143.1k51](/packages/robiningelbrecht-phpunit-coverage-tools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
