Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 28-Mar-2019 | - | ||||
src/ | H | 28-Mar-2019 | - | 8,117 | 5,065 | |
tests/ | H | 28-Mar-2019 | - | 4,782 | 3,899 | |
.php_cs | H A D | 27-Mar-2019 | 1.9 KiB | 70 | 67 | |
.travis.yml | H A D | 27-Mar-2019 | 781 | 43 | 32 | |
ChangeLog-2.2.md | H A D | 27-Mar-2019 | 2.3 KiB | 57 | 32 | |
ChangeLog-3.0.md | H A D | 27-Mar-2019 | 910 | 32 | 17 | |
ChangeLog-3.1.md | H A D | 27-Mar-2019 | 1,008 | 31 | 17 | |
ChangeLog-3.2.md | H A D | 27-Mar-2019 | 689 | 24 | 12 | |
ChangeLog-3.3.md | H A D | 27-Mar-2019 | 1 KiB | 34 | 18 | |
ChangeLog-4.0.md | H A D | 27-Mar-2019 | 2.2 KiB | 68 | 38 | |
LICENSE | H A D | 27-Mar-2019 | 1.5 KiB | 34 | 27 | |
README.md | H A D | 27-Mar-2019 | 1.8 KiB | 52 | 29 | |
build.xml | H A D | 27-Mar-2019 | 794 | 22 | 19 | |
composer.json | H A D | 27-Mar-2019 | 1.4 KiB | 52 | 51 | |
phpunit.xml | H A D | 27-Mar-2019 | 627 | 22 | 18 |
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