PHPackages                             tomzx/php-code-coverage-verifier - 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. tomzx/php-code-coverage-verifier

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

tomzx/php-code-coverage-verifier
================================

PHP Code Coverage Verifier

8908[4 issues](https://github.com/tomzx/php-code-coverage-verifier/issues)[2 PRs](https://github.com/tomzx/php-code-coverage-verifier/pulls)PHP

Since Mar 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/tomzx/php-code-coverage-verifier)[ Packagist](https://packagist.org/packages/tomzx/php-code-coverage-verifier)[ RSS](/packages/tomzx-php-code-coverage-verifier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Code Coverage Verifier
==========================

[](#php-code-coverage-verifier)

[![License](https://camo.githubusercontent.com/8979e3ff90efe90acd736567fe9889e66540a6b9e261c0d38fdc202b5bd81e03/68747470733a2f2f706f7365722e707567782e6f72672f746f6d7a782f7068702d636f64652d636f7665726167652d76657269666965722f6c6963656e73652e737667)](https://packagist.org/packages/tomzx/php-code-coverage-verifier)[![Latest Stable Version](https://camo.githubusercontent.com/1103cd516090c73560471d7d894a902d07ad556fe02e40280211470f4f594902/68747470733a2f2f706f7365722e707567782e6f72672f746f6d7a782f7068702d636f64652d636f7665726167652d76657269666965722f762f737461626c652e737667)](https://packagist.org/packages/tomzx/php-code-coverage-verifier)[![Latest Unstable Version](https://camo.githubusercontent.com/ab95a2a26d7b0bd0ab35e887e77ae6e27fdaf807aa28fe78b04f1aac846a56d1/68747470733a2f2f706f7365722e707567782e6f72672f746f6d7a782f7068702d636f64652d636f7665726167652d76657269666965722f762f756e737461626c652e737667)](https://packagist.org/packages/tomzx/php-code-coverage-verifier)[![Build Status](https://camo.githubusercontent.com/c1c5217b909be7d1dab76326ddb3c13a3cc5a91d54531e09e9e8d4d58004eeed/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f746f6d7a782f7068702d636f64652d636f7665726167652d76657269666965722e737667)](https://travis-ci.org/tomzx/php-code-coverage-verifier)[![Code Quality](https://camo.githubusercontent.com/ffb42a7da15e4be69d6f8a2bcd4875ca395c650d26a4ac9bf136790fb45d3ef0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f746f6d7a782f7068702d636f64652d636f7665726167652d76657269666965722e737667)](https://scrutinizer-ci.com/g/tomzx/php-code-coverage-verifier/code-structure)[![Code Coverage](https://camo.githubusercontent.com/baf837ebb6714ca2c1d0468e6da95fa9987da7c68d294d2419ae710439a1b26d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f746f6d7a782f7068702d636f64652d636f7665726167652d76657269666965722e737667)](https://scrutinizer-ci.com/g/tomzx/php-code-coverage-verifier)[![Total Downloads](https://camo.githubusercontent.com/194245c406b1c0425911b863eab72bce31cc8286415fd6aa448c76a14b4833c9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6d7a782f7068702d636f64652d636f7665726167652d76657269666965722e737667)](https://packagist.org/packages/tomzx/php-code-coverage-verifier)

**PHP Code Coverage Verifier** allows you to determine if a change you've just done to your PHP code is being tested/covered by your tests. It uses a clover-xml report from a phpunit run (or any other code coverage suite that outputs to clover-xml format) and a unified diff containing your changes. **PHP Code Coverage Verifier** will then generate a list of the covered and not covered changes.

Notice
------

[](#notice)

The code is currently in a very crude state. It was done as a proof of concept and will improve if it proves useful to others.

How to use
----------

[](#how-to-use)

**PHP Code Coverage Verifier** *ships* as a Composer package. You can include it in your project's composer.json and use in a console.

Before you run the command line, be sure to run your tests with phpunit (or other) and generate the clover xml file that will be used here. For instance, one can generate the clover-xml file with phpunit using `phpunit --coverage-clover=my-clover.xml`.

Then you need to generate the diff of your changes. Here we assume you will generate those using either `svn diff` or `git diff` (users of TortoiseGIT/TortoiseSVN can use "Create patch...").

```
php vendor/bin/php-code-coverage-verifier verify --help
Usage:
 verify [--display-not-covered-range[="..."]] clover-xml diff-file

Arguments:
 clover-xml                   Path to the clover-xml file
 diff-file                    Path to the diff-file

Options:
 --display-not-covered-range  Will display which line aren't covered (default: false)
 --help (-h)                  Display this help message.
 --quiet (-q)                 Do not output any message.
 --verbose (-v)               Increase verbosity of messages.
 --version (-V)               Display this application version.
 --ansi                       Force ANSI output.
 --no-ansi                    Disable ANSI output.
 --no-interaction (-n)        Do not ask any interactive question.

```

Example of (current) output
---------------------------

[](#example-of-current-output)

```
php vendor/bin/php-code-coverage-verifier verify my-clover.xml my-diff.patch
Using clover-xml file: my-clover.xml
With diff file: my-diff.patch

Covered:
controller/admin/stocks.php line 15 - 21
controller/admin/stocks.php line 91 - 97
controller/search.php line 26 - 32
controller/search.php line 376 - 384
model/user.php line 34 - 41
model/user.php line 44 - 51

Not covered:
controller/account.php line 39 - 45
controller/admin/stocks.php line 27 - 33
controller/search.php line 36 - 42
controller/search.php line 187 - 193
model/user.php line 533 - 540

Ignored:
application/composer.json

Coverage: 40 covered (56.338%), 31 not covered (43.662%)

```

Roadmap
-------

[](#roadmap)

- More output formatters
    - XML
    - HTML
    - Text (better)

License
-------

[](#license)

The code is licensed under the [MIT license](http://choosealicense.com/licenses/mit/). See [LICENSE](LICENSE).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/218f6db237e6937c05550d4d6df648f50cd9b26b098fc8c1be3930fe7d5c71e9?d=identicon)[tomzx](/maintainers/tomzx)

---

Top Contributors

[![tomzx](https://avatars.githubusercontent.com/u/188960?v=4)](https://github.com/tomzx "tomzx (16 commits)")

### Embed Badge

![Health badge](/badges/tomzx-php-code-coverage-verifier/health.svg)

```
[![Health](https://phpackages.com/badges/tomzx-php-code-coverage-verifier/health.svg)](https://phpackages.com/packages/tomzx-php-code-coverage-verifier)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M359](/packages/dms-phpunit-arraysubset-asserts)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

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