PHPackages                             blpraveen/php-coveralls - 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. blpraveen/php-coveralls

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

blpraveen/php-coveralls
=======================

PHP client library for Coveralls API

v2.4.3(5y ago)06MITPHPPHP ^5.5 || ^7.0 || ^8.0

Since Apr 15Pushed 4y agoCompare

[ Source](https://github.com/blpraveen/php-coveralls)[ Packagist](https://packagist.org/packages/blpraveen/php-coveralls)[ Docs](https://github.com/php-coveralls/php-coveralls)[ RSS](/packages/blpraveen-php-coveralls/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (8)Versions (25)Used By (0)

php-coveralls
=============

[](#php-coveralls)

[![Build Status](https://camo.githubusercontent.com/87c35b9e5fb5b7a0f3537c9a172381c67cd1d552a2ab89cde6b4f3d28215877d/68747470733a2f2f7472617669732d63692e6f72672f7068702d636f766572616c6c732f7068702d636f766572616c6c732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-coveralls/php-coveralls)[![Coverage Status](https://camo.githubusercontent.com/aa090178d19fe607653ff084b88da5fe7e6fda6c9eaf65da210617625a6ff464/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7068702d636f766572616c6c732f7068702d636f766572616c6c732f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/php-coveralls/php-coveralls)

[![Latest Stable Version](https://camo.githubusercontent.com/86d4bf8d3038ada43ab162842138e947e35a8ba61542ecbef09d4b3dd08cb15b/68747470733a2f2f706f7365722e707567782e6f72672f7068702d636f766572616c6c732f7068702d636f766572616c6c732f762f737461626c652e706e67)](https://packagist.org/packages/php-coveralls/php-coveralls)[![Total Downloads](https://camo.githubusercontent.com/915c31f0900220b8157252a922ec7fb94ef9ea0b54d301c737dd2b03e6ca261a/68747470733a2f2f706f7365722e707567782e6f72672f7068702d636f766572616c6c732f7068702d636f766572616c6c732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/php-coveralls/php-coveralls)

PHP client library for [Coveralls](https://coveralls.io).

Prerequisites
=============

[](#prerequisites)

- PHP 5.5+ for 2.x or 5.3+ for 1.x
- On [GitHub](https://github.com/)
- Building on [Travis CI](http://travis-ci.org/), [CircleCI](https://circleci.com/), [Jenkins](http://jenkins-ci.org/) or [Codeship](https://www.codeship.io/)
- Testing by [PHPUnit](https://github.com/sebastianbergmann/phpunit/) or other testing framework that can generate clover style coverage report

Installation
============

[](#installation)

Download phar file
------------------

[](#download-phar-file)

We started to create a phar file, starting from the version 0.7.0 release. It is available at the URLs like:

```
https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar

```

Download the file and add exec permissions:

```
$ wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar
$ chmod +x php-coveralls.phar
```

Install by composer
-------------------

[](#install-by-composer)

To install php-coveralls with Composer, run the following command:

```
$ composer require --dev php-coveralls/php-coveralls
```

If you need support for PHP versions older than 5.5, you will need to use a 1.x version:

```
$ composer require --dev 'php-coveralls/php-coveralls:^1.1'
```

You can see this library on [Packagist](https://packagist.org/packages/php-coveralls/php-coveralls).

Composer installs autoloader at `./vendor/autoloader.php`. If you use php-coveralls in your php script, add:

```
require_once 'vendor/autoload.php';
```

If you use Symfony2, autoloader has to be detected automatically.

Use it from your git clone
--------------------------

[](#use-it-from-your-git-clone)

Or you can use git clone command:

```
# HTTP
$ git clone https://github.com/php-coveralls/php-coveralls.git
# SSH
$ git clone git@github.com:php-coveralls/php-coveralls.git
```

Configuration
=============

[](#configuration)

Currently php-coveralls supports clover style coverage report and collects coverage information from `clover.xml`.

PHPUnit
-------

[](#phpunit)

Make sure that `phpunit.xml.dist` is configured to generate "coverage-clover" type log named `clover.xml` like the following configuration:

```

        ...

        ...

```

You can also use `--coverage-clover` CLI option.

```
phpunit --coverage-clover build/logs/clover.xml
```

### phpcov

[](#phpcov)

Above settings are good for most projects if your test suite is executed once a build and is not divided into several parts. But if your test suite is configured as parallel tasks or generates multiple coverage reports through a build, you can use either `coverage_clover` configuration in `.coveralls.yml` ([see below coverage clover configuration section](#coverage-clover-configuration)) to specify multiple `clover.xml` files or `phpcov` for processing coverage reports.

#### composer.json

[](#composerjson)

```
    "require-dev": {
        "php-coveralls/php-coveralls": "^2.4",
        "phpunit/phpcov": "^2.0"
    },
```

#### phpunit configuration

[](#phpunit-configuration)

Make sure that `phpunit.xml.dist` is configured to generate "coverage-php" type log:

```

        ...

        ...

```

You can also use `--coverage-php` CLI option.

```
# use --coverage-php option instead of --coverage-clover
phpunit --coverage-php build/cov/coverage-${component_name}.cov
```

#### phpcov configuration

[](#phpcov-configuration)

And then, execute `phpcov.php` to merge `coverage.cov` logs.

```
# get information
php vendor/bin/phpcov.php --help

# merge coverage.cov logs under build/cov
php vendor/bin/phpcov.php merge --clover build/logs/clover.xml build/cov

# in case of memory exhausting error
php -d memory_limit=-1 vendor/bin/phpcov.php ...
```

### clover.xml

[](#cloverxml)

php-coveralls collects `count` attribute in a `line` tag from `clover.xml` if its `type` attribute equals to `stmt`. When `type` attribute equals to `method`, php-coveralls excludes its `count` attribute from coverage collection because abstract method in an abstract class is never counted though subclasses implement that method which is executed in test cases.

```

```

Travis CI
---------

[](#travis-ci)

Add `php php-coveralls.phar` or `php vendor/bin/php-coveralls` to your `.travis.yml` at `after_success`.

```
# .travis.yml
language: php
php:
  - 5.5
  - 5.4
  - 5.3

matrix:
  allow_failures:
    - php: 5.5

install:
  - curl -s http://getcomposer.org/installer | php
  - php composer.phar install --dev --no-interaction
script:
  - mkdir -p build/logs
  - php vendor/bin/phpunit -c phpunit.xml.dist

after_success:
  - travis_retry php vendor/bin/php-coveralls
  # or enable logging
  - travis_retry php vendor/bin/php-coveralls -v
```

CircleCI
--------

[](#circleci)

Enable Xdebug in your `circle.yml` at `dependencies` section since currently Xdebug extension is not pre-enabled. `composer` and `phpunit` are pre-installed but you can install them manually in this dependencies section. The following sample uses default ones.

```
machine:
  php:
    version: 5.4.10

## Customize dependencies
dependencies:
  override:
    - mkdir -p build/logs
    - composer install --dev --no-interaction
    - sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini

## Customize test commands
test:
  override:
    - phpunit -c phpunit.xml.dist
```

Add `COVERALLS_REPO_TOKEN` environment variable with your coveralls repo token on Web UI (Tweaks -&gt; Environment Variable).

Codeship
--------

[](#codeship)

You can configure CI process for Coveralls by adding the following commands to the textarea on Web UI (Project settings &gt; Test tab).

In the "Modify your Setup Commands" section:

```
curl -s http://getcomposer.org/installer | php
php composer.phar install --dev --no-interaction
mkdir -p build/logs
```

In the "Modify your Test Commands" section:

```
php vendor/bin/phpunit -c phpunit.xml.dist
php vendor/bin/php-coveralls
```

Next, open Project settings &gt; Environment tab, you can set `COVERALLS_REPO_TOKEN` environment variable.

In the "Configure your environment variables" section:

```
COVERALLS_REPO_TOKEN=your_token
```

GitHub Actions
--------------

[](#github-actions)

Add a new step after phpunit generate coverage report.

```
- name: Upload coverage results to Coveralls
  env:
    COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    composer global require php-coveralls/php-coveralls
    php-coveralls --coverage_clover=build/logs/clover.xml -v
```

From local environment
----------------------

[](#from-local-environment)

If you would like to call Coveralls API from your local environment, you can set `COVERALLS_RUN_LOCALLY` environment variable. This configuration requires `repo_token` to specify which project on Coveralls your project maps to. This can be done by configuring `.coveralls.yml` or `COVERALLS_REPO_TOKEN` environment variable.

```
$ export COVERALLS_RUN_LOCALLY=1

# either env var
$ export COVERALLS_REPO_TOKEN=your_token

# or .coveralls.yml configuration
$ vi .coveralls.yml
repo_token: your_token # should be kept secret!
```

php-coveralls set the following properties to `json_file` which is sent to Coveralls API (same behaviour as the Ruby library will do except for the service name).

- service\_name: php-coveralls
- service\_event\_type: manual

Parallel Builds
---------------

[](#parallel-builds)

Coveralls provides the ability to combine coverage result from multiple parallel builds into one. To enable the feature you can set the following in your environment variable.

```
COVERALLS_PARALLEL=true
```

To distinguish your job name, please set the `COVERALLS_FLAG_NAME` environment variable.

```
COVERALLS_FLAG_NAME=$YOUR_PHP_VERSION
```

Bear in mind that you will need to configure your build to send a webhook after all the parallel builds are done in order for Coveralls to merge the results.

Refer to [Parallel Builds Webhook](https://docs.coveralls.io/parallel-build-webhook) for more information for setup on your environment.

CLI options
-----------

[](#cli-options)

You can get help information for `coveralls` with the `--help (-h)` option.

```
php vendor/bin/php-coveralls --help
```

- `--config (-c)`: Used to specify the path to `.coveralls.yml`. Default is `.coveralls.yml`
- `--verbose (-v)`: Used to show logs.
- `--dry-run`: Used not to send json\_file to Coveralls Jobs API.
- `--exclude-no-stmt`: Used to exclude source files that have no executable statements.
- `--env (-e)`: Runtime environment name: test, dev, prod (default: "prod")
- `--coverage_clover (-x)`: Coverage clover xml files(allowing multiple values)
- `--json_path` (-o): Used to specify where to output json\_file that will be uploaded to Coveralls API. (default: `build/logs/coveralls-upload.json`)
- `--root_dir (-r)`: Root directory of the project. (default: ".")

.coveralls.yml
--------------

[](#coverallsyml)

php-coveralls can use optional `.coveralls.yml` file to configure options. This configuration file is usually at the root level of your repository, but you can specify other path by `--config (or -c)` CLI option. Following options are the same as Ruby library ([see reference on coveralls.io](https://coveralls.io/docs/ruby)).

- `repo_token`: Used to specify which project on Coveralls your project maps to. This is only needed for repos not using CI and should be kept secret
- `service_name`: Allows you to specify where Coveralls should look to find additional information about your builds. This can be any string, but using `travis-ci` or `travis-pro` will allow Coveralls to fetch branch data, comment on pull requests, and more.

Following options can be used for php-coveralls.

- `entry_point`: Used to specify API endpoint for sending reports. Useful when using self-hosted coveralls or other other, similar service (eg opencov). Default is `https://coveralls.io`.
- `coverage_clover`: Used to specify the path to `clover.xml`. Default is `build/logs/clover.xml`
- `json_path`: Used to specify where to output `json_file` that will be uploaded to Coveralls API. Default is `build/logs/coveralls-upload.json`.

```
# .coveralls.yml example configuration

# same as Ruby lib
repo_token: your_token # should be kept secret!
service_name: travis-pro # travis-ci or travis-pro

# for php-coveralls
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
```

### coverage clover configuration

[](#coverage-clover-configuration)

You can specify multiple `clover.xml` logs at `coverage_clover`. This is useful for a project that has more than two test suites if all of the test results should be merged into one `json_file`.

```
#.coveralls.yml

# single file
coverage_clover: build/logs/clover.xml

# glob
coverage_clover: build/logs/clover-*.xml

# array
# specify files
coverage_clover:
  - build/logs/clover-Auth.xml
  - build/logs/clover-Db.xml
  - build/logs/clover-Validator.xml
```

You can also use `--coverage_clover` (or `-x`) command line option as follows:

```
coveralls --coverage_clover=build/logs/my-clover.xml

```

### root\_dir detection and override

[](#root_dir-detection-and-override)

This tool assume the current directory is the project root directory by default. You can override it with `--root_dir` command line option.

Change log
==========

[](#change-log)

[See changelog](CHANGELOG.md)

Wiki
====

[](#wiki)

[See wiki](https://github.com/php-coveralls/php-coveralls/wiki)

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 60.3% 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 ~127 days

Recently: every ~22 days

Total

23

Last Release

1962d ago

Major Versions

v0.7.1 → v1.0.02015-12-28

v1.1.0 → v2.0.02017-12-08

PHP version history (6 changes)0.1.0PHP &gt;=5.3.17

0.5.0PHP &gt;=5.3

v0.7.0PHP &gt;=5.3.3

v1.0.2PHP ^5.3.3 || ^7.0

v2.0.0PHP ^5.5 || ^7.0

v2.4.0PHP ^5.5 || ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c73b7fe8ab5044ff8685c49d169961bc2b20d1d54b687bc81b8440b08f764671?d=identicon)[blpraveen](/maintainers/blpraveen)

---

Top Contributors

[![keradus](https://avatars.githubusercontent.com/u/2716794?v=4)](https://github.com/keradus "keradus (79 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (6 commits)")[![onema](https://avatars.githubusercontent.com/u/532616?v=4)](https://github.com/onema "onema (5 commits)")[![GeLoLabs](https://avatars.githubusercontent.com/u/149005863?v=4)](https://github.com/GeLoLabs "GeLoLabs (4 commits)")[![bartfeenstra](https://avatars.githubusercontent.com/u/376735?v=4)](https://github.com/bartfeenstra "bartfeenstra (3 commits)")[![shadowhand](https://avatars.githubusercontent.com/u/38203?v=4)](https://github.com/shadowhand "shadowhand (3 commits)")[![BenMorel](https://avatars.githubusercontent.com/u/1952838?v=4)](https://github.com/BenMorel "BenMorel (3 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (2 commits)")[![philsturgeon](https://avatars.githubusercontent.com/u/67381?v=4)](https://github.com/philsturgeon "philsturgeon (2 commits)")[![renan](https://avatars.githubusercontent.com/u/28046?v=4)](https://github.com/renan "renan (2 commits)")[![sanmai](https://avatars.githubusercontent.com/u/139488?v=4)](https://github.com/sanmai "sanmai (2 commits)")[![dshemin](https://avatars.githubusercontent.com/u/11780307?v=4)](https://github.com/dshemin "dshemin (2 commits)")[![KazuakiM](https://avatars.githubusercontent.com/u/1524429?v=4)](https://github.com/KazuakiM "KazuakiM (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![oanhnn](https://avatars.githubusercontent.com/u/1757120?v=4)](https://github.com/oanhnn "oanhnn (1 commits)")[![simoheinonen](https://avatars.githubusercontent.com/u/3840367?v=4)](https://github.com/simoheinonen "simoheinonen (1 commits)")[![Zayon](https://avatars.githubusercontent.com/u/3958468?v=4)](https://github.com/Zayon "Zayon (1 commits)")[![abacaphiliac](https://avatars.githubusercontent.com/u/1656273?v=4)](https://github.com/abacaphiliac "abacaphiliac (1 commits)")[![zomble](https://avatars.githubusercontent.com/u/542255?v=4)](https://github.com/zomble "zomble (1 commits)")[![alnutile](https://avatars.githubusercontent.com/u/365385?v=4)](https://github.com/alnutile "alnutile (1 commits)")

---

Tags

testcoveragegithubci

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/blpraveen-php-coveralls/health.svg)

```
[![Health](https://phpackages.com/badges/blpraveen-php-coveralls/health.svg)](https://phpackages.com/packages/blpraveen-php-coveralls)
```

###  Alternatives

[php-coveralls/php-coveralls

PHP client library for Coveralls API

51413.7M3.4k](/packages/php-coveralls-php-coveralls)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M385](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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