Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebastianbergmann/php-code-coverage
Library that provides collection, processing, and rendering functionality for PHP code coverage information.
https://github.com/sebastianbergmann/php-code-coverage
Last synced: 6 days ago
JSON representation
Library that provides collection, processing, and rendering functionality for PHP code coverage information.
- Host: GitHub
- URL: https://github.com/sebastianbergmann/php-code-coverage
- Owner: sebastianbergmann
- License: bsd-3-clause
- Created: 2009-05-28T16:01:43.000Z (over 15 years ago)
- Default Branch: main
- Last Pushed: 2024-10-17T07:51:23.000Z (3 months ago)
- Last Synced: 2024-10-29T21:59:06.086Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 59.2 MB
- Stars: 8,818
- Watchers: 56
- Forks: 375
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog-11.0.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- favorite-link - 为 PHP 代码覆盖率信息提供收集,处理和呈现功能的库。
- php-awesome - CodeCoverage - 代码覆盖率报表工具 (类库 / 代码检查/静态分析)
README
# phpunit/php-code-coverage
[![Latest Stable Version](https://poser.pugx.org/phpunit/php-code-coverage/v)](https://packagist.org/packages/phpunit/php-code-coverage)
[![CI Status](https://github.com/sebastianbergmann/php-code-coverage/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/php-code-coverage/actions)
[![codecov](https://codecov.io/gh/sebastianbergmann/php-code-coverage/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/php-code-coverage)Provides collection, processing, and rendering functionality for PHP code coverage information.
## Installation
You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):
```
composer require phpunit/php-code-coverage
```If 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:
```
composer require --dev phpunit/php-code-coverage
```## Usage
```php
includeFiles(
[
'/path/to/file.php',
'/path/to/another_file.php',
]
);$coverage = new CodeCoverage(
(new Selector)->forLineCoverage($filter),
$filter
);$coverage->start('');
// ...
$coverage->stop();
(new HtmlReport)->process($coverage, '/tmp/code-coverage-report');
```