Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 7, 2024 via composer

phpunit/php-code-coverage 9.2.16

Library that provides collection, processing, and rendering functionality for PHP code coverage information.
Package summary
Share
0
issues
1
license
10
BSD-3-Clause
Package created
18 Sep 2012
Version published
20 Aug 2022
Maintainers
1
Total deps
10
Direct deps
9
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
10 Packages, Including:
nikic/php-parser@v4.19.1
phpunit/php-code-coverage@9.2.16
phpunit/php-file-iterator@3.0.6
phpunit/php-text-template@2.0.4
sebastian/code-unit-reverse-lookup@2.0.3
sebastian/complexity@2.0.3
sebastian/environment@5.1.5
sebastian/lines-of-code@1.0.4
sebastian/version@3.0.2
theseer/tokenizer@1.2.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

9
All Dependencies CSV
β“˜ This is a list of phpunit/php-code-coverage 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
nikic/php-parserv4.19.1-BSD-3-Clause
prod
phpunit/php-file-iterator3.0.68.05 kBBSD-3-Clause
prod
phpunit/php-text-template2.0.46.77 kBBSD-3-Clause
prod
sebastian/code-unit-reverse-lookup2.0.34.38 kBBSD-3-Clause
prod
sebastian/complexity2.0.310.7 kBBSD-3-Clause
prod
sebastian/environment5.1.58.94 kBBSD-3-Clause
prod
sebastian/lines-of-code1.0.49.15 kBBSD-3-Clause
prod
sebastian/version3.0.24.76 kBBSD-3-Clause
prod
theseer/tokenizer1.2.3-BSD-3-Clause
prod

Visualizations

Frequently Asked Questions

What does phpunit/php-code-coverage do?

phpunit/php-code-coverage is a robust and versatile PHP library, providing the essential functions for collection, processing, and rendering of PHP code coverage information. Code coverage is a key measure used in software testing to describe the degree to which the source code of a program is tested by a particular test suite. The library collects the data and renders the information so it can be used by developers to improve their code and testing.

How do you use phpunit/php-code-coverage?

Utilizing phpunit/php-code-coverage is straightforward for anyone familiar with PHP and composer packages. Installation is completed through Composer by running the following command providing the package as a local per-project dependency:

composer require phpunit/php-code-coverage

For installation as a development-time dependency, which might be required to run a project's test suite, you should add it as follows:

composer require --dev phpunit/php-code-coverage

Here's a basic usage sample for phpunit/php-code-coverage in your PHP script:

<?php declare(strict_types=1);
use SebastianBergmann\CodeCoverage\Filter;
use SebastianBergmann\CodeCoverage\Driver\Selector;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Report\Html\Facade as HtmlReport;

$filter = new Filter;
$filter->includeFiles(['/path/to/file.php', '/path/to/another_file.php']);

$coverage = new CodeCoverage(
    (new Selector)->forLineCoverage($filter),
    $filter
);

$coverage->start('<name of test>');
// Execute your test code here...
$coverage->stop();

(new HtmlReport)->process($coverage, '/tmp/code-coverage-report');

In the above code snippet, the library is used to start coverage, execute test code within the start/stop block, and then process the coverage data into HTML report format.

Where are the phpunit/php-code-coverage docs?

The comprehensive documentation of phpunit/php-code-coverage can be reached through the repository on GitHub at sebastianbergmann/php-code-coverage. The repository contains thorough explanations and additional usage examples for various functions and interfaces offered by the library.