Documentation

PHP_CodeCoverage
in package

Provides collection functionality for PHP code coverage information.

Tags
since

Class available since Release 1.0.0

Table of Contents

$addUncoveredFilesFromWhitelist  : bool
$cacheTokens  : bool
$checkForUnintentionallyCoveredCode  : bool
$currentId  : mixed
$data  : array<string|int, mixed>
Code coverage data.
$disableIgnoredLines  : bool
$driver  : PHP_CodeCoverage_Driver
$filter  : PHP_CodeCoverage_Filter
$forceCoversAnnotation  : bool
$ignoredLines  : array<string|int, mixed>
$mapTestClassNameToCoveredClassName  : bool
$processUncoveredFilesFromWhitelist  : bool
$tests  : array<string|int, mixed>
Test data.
__construct()  : mixed
Constructor.
append()  : mixed
Appends code coverage data.
clear()  : mixed
Clears collected code coverage data.
filter()  : PHP_CodeCoverage_Filter
Returns the PHP_CodeCoverage_Filter used.
getCacheTokens()  : mixed
getData()  : array<string|int, mixed>
Returns the collected code coverage data.
getReport()  : PHP_CodeCoverage_Report_Node_Directory
Returns the PHP_CodeCoverage_Report_Node_* object graph for this PHP_CodeCoverage object.
getTests()  : array<string|int, mixed>
Returns the test data.
merge()  : mixed
Merges the data from another instance of PHP_CodeCoverage.
setAddUncoveredFilesFromWhitelist()  : mixed
setCacheTokens()  : mixed
setCheckForUnintentionallyCoveredCode()  : mixed
setData()  : mixed
Sets the coverage data.
setDisableIgnoredLines()  : mixed
setForceCoversAnnotation()  : mixed
setMapTestClassNameToCoveredClassName()  : mixed
setProcessUncoveredFilesFromWhitelist()  : mixed
setTests()  : mixed
Sets the test data.
start()  : mixed
Start collection of code coverage information.
stop()  : array<string|int, mixed>
Stop collection of code coverage information.
addUncoveredFilesFromWhitelist()  : mixed
Processes whitelisted files that are not covered.
applyCoversAnnotationFilter()  : mixed
Applies the @covers annotation filtering.
applyIgnoredLinesFilter()  : mixed
Applies the "ignored lines" filtering.
applyListsFilter()  : mixed
Applies the blacklist/whitelist filtering.
getAllowedLines()  : array<string|int, mixed>
getLinesToBeIgnored()  : array<string|int, mixed>
Returns the lines of a source file that should be ignored.
initializeFilesThatAreSeenTheFirstTime()  : mixed
performUnintentionallyCoveredCodeCheck()  : mixed
processUncoveredFileFromWhitelist()  : mixed
selectDriver()  : PHP_CodeCoverage_Driver

Properties

$addUncoveredFilesFromWhitelist

private bool $addUncoveredFilesFromWhitelist = rue

$checkForUnintentionallyCoveredCode

private bool $checkForUnintentionallyCoveredCode = alse

$data

Code coverage data.

private array<string|int, mixed> $data = array()

$disableIgnoredLines

private bool $disableIgnoredLines = alse

$forceCoversAnnotation

private bool $forceCoversAnnotation = alse

$ignoredLines

private array<string|int, mixed> $ignoredLines = array()

$mapTestClassNameToCoveredClassName

private bool $mapTestClassNameToCoveredClassName = alse

$processUncoveredFilesFromWhitelist

private bool $processUncoveredFilesFromWhitelist = alse

$tests

Test data.

private array<string|int, mixed> $tests = array()

Methods

append()

Appends code coverage data.

public append(array<string|int, mixed> $data[, mixed $id = null ][, bool $append = true ][, mixed $linesToBeCovered = array() ][, array<string|int, mixed> $linesToBeUsed = array() ]) : mixed
Parameters
$data : array<string|int, mixed>
$id : mixed = null
$append : bool = true
$linesToBeCovered : mixed = array()
$linesToBeUsed : array<string|int, mixed> = array()
Tags
throws
PHP_CodeCoverage_Exception
Return values
mixed

clear()

Clears collected code coverage data.

public clear() : mixed
Return values
mixed

getCacheTokens()

public getCacheTokens() : mixed
Tags
since

Method available since Release 1.1.0

Return values
mixed

getData()

Returns the collected code coverage data.

public getData([bool $raw = false ]) : array<string|int, mixed>

Set $raw = true to bypass all filters.

Parameters
$raw : bool = false
Tags
since

Method available since Release 1.1.0

Return values
array<string|int, mixed>

getTests()

Returns the test data.

public getTests() : array<string|int, mixed>
Tags
since

Method available since Release 1.1.0

Return values
array<string|int, mixed>

setCacheTokens()

public setCacheTokens(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHP_CodeCoverage_Exception
since

Method available since Release 1.1.0

Return values
mixed

setCheckForUnintentionallyCoveredCode()

public setCheckForUnintentionallyCoveredCode(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHP_CodeCoverage_Exception
since

Method available since Release 2.0.0

Return values
mixed

setData()

Sets the coverage data.

public setData(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Tags
since

Method available since Release 2.0.0

Return values
mixed

setMapTestClassNameToCoveredClassName()

public setMapTestClassNameToCoveredClassName(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHP_CodeCoverage_Exception
Return values
mixed

setProcessUncoveredFilesFromWhitelist()

public setProcessUncoveredFilesFromWhitelist(bool $flag) : mixed
Parameters
$flag : bool
Tags
throws
PHP_CodeCoverage_Exception
Return values
mixed

setTests()

Sets the test data.

public setTests(array<string|int, mixed> $tests) : mixed
Parameters
$tests : array<string|int, mixed>
Tags
since

Method available since Release 2.0.0

Return values
mixed

start()

Start collection of code coverage information.

public start(mixed $id[, bool $clear = false ]) : mixed
Parameters
$id : mixed
$clear : bool = false
Tags
throws
PHP_CodeCoverage_Exception
Return values
mixed

stop()

Stop collection of code coverage information.

public stop([bool $append = true ][, mixed $linesToBeCovered = array() ][, array<string|int, mixed> $linesToBeUsed = array() ]) : array<string|int, mixed>
Parameters
$append : bool = true
$linesToBeCovered : mixed = array()
$linesToBeUsed : array<string|int, mixed> = array()
Tags
throws
PHP_CodeCoverage_Exception
Return values
array<string|int, mixed>

addUncoveredFilesFromWhitelist()

Processes whitelisted files that are not covered.

private addUncoveredFilesFromWhitelist() : mixed
Return values
mixed

applyCoversAnnotationFilter()

Applies the @covers annotation filtering.

private applyCoversAnnotationFilter(array<string|int, mixed> &$data, mixed $linesToBeCovered, array<string|int, mixed> $linesToBeUsed) : mixed
Parameters
$data : array<string|int, mixed>
$linesToBeCovered : mixed
$linesToBeUsed : array<string|int, mixed>
Tags
throws
PHP_CodeCoverage_Exception_UnintentionallyCoveredCode
Return values
mixed

applyIgnoredLinesFilter()

Applies the "ignored lines" filtering.

private applyIgnoredLinesFilter(array<string|int, mixed> &$data) : mixed
Parameters
$data : array<string|int, mixed>
Return values
mixed

applyListsFilter()

Applies the blacklist/whitelist filtering.

private applyListsFilter(array<string|int, mixed> &$data) : mixed
Parameters
$data : array<string|int, mixed>
Return values
mixed

getAllowedLines()

private getAllowedLines(array<string|int, mixed> $linesToBeCovered, array<string|int, mixed> $linesToBeUsed) : array<string|int, mixed>
Parameters
$linesToBeCovered : array<string|int, mixed>
$linesToBeUsed : array<string|int, mixed>
Tags
since

Method available since Release 2.0.0

Return values
array<string|int, mixed>

getLinesToBeIgnored()

Returns the lines of a source file that should be ignored.

private getLinesToBeIgnored(string $filename) : array<string|int, mixed>
Parameters
$filename : string
Tags
throws
PHP_CodeCoverage_Exception
since

Method available since Release 2.0.0

Return values
array<string|int, mixed>

initializeFilesThatAreSeenTheFirstTime()

private initializeFilesThatAreSeenTheFirstTime(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Tags
since

Method available since Release 1.1.0

Return values
mixed

performUnintentionallyCoveredCodeCheck()

private performUnintentionallyCoveredCodeCheck(array<string|int, mixed> &$data, array<string|int, mixed> $linesToBeCovered, array<string|int, mixed> $linesToBeUsed) : mixed
Parameters
$data : array<string|int, mixed>
$linesToBeCovered : array<string|int, mixed>
$linesToBeUsed : array<string|int, mixed>
Tags
throws
PHP_CodeCoverage_Exception_UnintentionallyCoveredCode
since

Method available since Release 2.0.0

Return values
mixed

processUncoveredFileFromWhitelist()

private processUncoveredFileFromWhitelist(string $uncoveredFile, array<string|int, mixed> &$data, array<string|int, mixed> $uncoveredFiles) : mixed
Parameters
$uncoveredFile : string
$data : array<string|int, mixed>
$uncoveredFiles : array<string|int, mixed>
Return values
mixed

Search results