• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..28-Mar-2019-

src/H28-Mar-2019-8,1175,065

tests/H28-Mar-2019-4,7823,899

.php_csH A D27-Mar-20191.9 KiB7067

.travis.ymlH A D27-Mar-2019781 4332

ChangeLog-2.2.mdH A D27-Mar-20192.3 KiB5732

ChangeLog-3.0.mdH A D27-Mar-2019910 3217

ChangeLog-3.1.mdH A D27-Mar-20191,008 3117

ChangeLog-3.2.mdH A D27-Mar-2019689 2412

ChangeLog-3.3.mdH A D27-Mar-20191 KiB3418

ChangeLog-4.0.mdH A D27-Mar-20192.2 KiB6838

LICENSEH A D27-Mar-20191.5 KiB3427

README.mdH A D27-Mar-20191.8 KiB5229

build.xmlH A D27-Mar-2019794 2219

composer.jsonH A D27-Mar-20191.4 KiB5251

phpunit.xmlH A D27-Mar-2019627 2218

README.md

1[![Latest Stable Version](https://poser.pugx.org/phpunit/php-code-coverage/v/stable.png)](https://packagist.org/packages/phpunit/php-code-coverage)
2[![Build Status](https://travis-ci.org/sebastianbergmann/php-code-coverage.svg?branch=master)](https://travis-ci.org/sebastianbergmann/php-code-coverage)
3
4# PHP_CodeCoverage
5
6**PHP_CodeCoverage** is a library that provides collection, processing, and rendering functionality for PHP code coverage information.
7
8## Requirements
9
10PHP 5.6 is required but using the latest version of PHP is highly recommended.
11
12### PHP 5
13
14[Xdebug](http://xdebug.org/) is the only source of raw code coverage data supported for PHP 5. Version 2.2.1 of Xdebug is required but using the latest version is highly recommended.
15
16### PHP 7
17
18Version 2.4.0 (or later) of [Xdebug](http://xdebug.org/) as well as [phpdbg](http://phpdbg.com/docs) are supported sources of raw code coverage data for PHP 7.
19
20### HHVM
21
22A version of HHVM that implements the Xdebug API for code coverage (`xdebug_*_code_coverage()`) is required.
23
24## Installation
25
26You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):
27
28    composer require phpunit/php-code-coverage
29
30If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:
31
32    composer require --dev phpunit/php-code-coverage
33
34## Using the PHP_CodeCoverage API
35
36```php
37<?php
38$coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage;
39$coverage->start('<name of test>');
40
41// ...
42
43$coverage->stop();
44
45$writer = new \SebastianBergmann\CodeCoverage\Report\Clover;
46$writer->process($coverage, '/tmp/clover.xml');
47
48$writer = new \SebastianBergmann\CodeCoverage\Report\Html\Facade;
49$writer->process($coverage, '/tmp/code-coverage-report');
50```
51
52