PHPackages                             laxit/clover-to-lcov - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. laxit/clover-to-lcov

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laxit/clover-to-lcov
====================

Converts your Phpunit's Clover xml report to CI friendly LCOV report

0146↓50%PHP

Since Dec 12Pushed 5mo agoCompare

[ Source](https://github.com/laxit-patel/clover-to-lcov)[ Packagist](https://packagist.org/packages/laxit/clover-to-lcov)[ RSS](/packages/laxit-clover-to-lcov/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

 [![Verdant Cloverstone](art/verdant_cloverstone.png)](art/verdant_cloverstone.png)

💚 Verdant Cloverstone
=====================

[](#-verdant-cloverstone)

**Clover to LCOV Converter** — transforms PHPUnit's Clover XML coverage reports into the universal LCOV format.

> *The Verdant Cloverstone converts raw, scattered data into a polished, unified report, embodying the precise transformation of Clover XML into the LCOV standard.*

---

Why?
----

[](#why)

PHPUnit generates Clover XML coverage reports, but many CI tools (GitHub Actions, GitLab CI, Codecov, Coveralls) prefer LCOV format. This package bridges that gap.

```
clover.xml  →  💚  →  coverage.lcov

```

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

[](#installation)

```
composer require laxit/clover-to-lcov
```

Usage
-----

[](#usage)

### CLI

[](#cli)

```
# Output to stdout
./vendor/bin/clover-to-lcov coverage/clover.xml

# Output to file
./vendor/bin/clover-to-lcov coverage/clover.xml -o coverage.lcov
```

### Programmatic

[](#programmatic)

```
use Laxit\CloverToLcov\Converter;

$converter = new Converter();

// Convert and get LCOV string
$lcov = $converter->convert('coverage/clover.xml');

// Convert and save to file
$converter->convertAndSave('coverage/clover.xml', 'coverage.lcov');

// Convert from XML string directly
$lcov = $converter->convertFromString($cloverXmlContent);
```

CI Integration
--------------

[](#ci-integration)

### GitHub Actions

[](#github-actions)

```
- name: Run tests with coverage
  run: vendor/bin/phpunit --coverage-clover coverage/clover.xml

- name: Convert to LCOV
  run: vendor/bin/clover-to-lcov coverage/clover.xml -o coverage/lcov.info

- name: Upload coverage to Codecov
  uses: codecov/codecov-action@v3
  with:
    files: coverage/lcov.info
```

### GitLab CI

[](#gitlab-ci)

```
test:
  script:
    - vendor/bin/phpunit --coverage-clover coverage/clover.xml
    - vendor/bin/clover-to-lcov coverage/clover.xml -o coverage/lcov.info
  artifacts:
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage/lcov.info
```

LCOV Output Format
------------------

[](#lcov-output-format)

The generated LCOV file follows the standard format:

```
TN:
SF:/path/to/File.php
FNDA:5,methodName
FNF:1
FNH:1
DA:10,1
DA:11,5
DA:12,0
LF:3
LH:2
end_of_record

```

TagDescription`TN`Test name`SF`Source file path`FNDA`Function hit count`FNF`Functions found`FNH`Functions hit`DA`Line hit data`LF`Lines found`LH`Lines hitRequirements
------------

[](#requirements)

- PHP ^8.1
- ext-simplexml

License
-------

[](#license)

MIT

---

 Part of the **Laxit Artifact Collection**
 [💚 Verdant Cloverstone](https://github.com/laxit-patel) · [🔑 Mnemonic Sigil](https://github.com/laxit-patel/keychan)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance49

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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/a8926d4f33f8bb0b3287a1793ffb55ec5fd259cdc46186cf6d5d94e4bbd0560c?d=identicon)[laxit-patel](/maintainers/laxit-patel)

---

Top Contributors

[![laxit-patel](https://avatars.githubusercontent.com/u/24682969?v=4)](https://github.com/laxit-patel "laxit-patel (1 commits)")

### Embed Badge

![Health badge](/badges/laxit-clover-to-lcov/health.svg)

```
[![Health](https://phpackages.com/badges/laxit-clover-to-lcov/health.svg)](https://phpackages.com/packages/laxit-clover-to-lcov)
```

PHPackages © 2026

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