PHP_CodeCoverage
in package
Provides collection functionality for PHP code coverage information.
Tags
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
$cacheTokens
private
bool
$cacheTokens
= alse
$checkForUnintentionallyCoveredCode
private
bool
$checkForUnintentionallyCoveredCode
= alse
$currentId
private
mixed
$currentId
$data
Code coverage data.
private
array<string|int, mixed>
$data
= array()
$disableIgnoredLines
private
bool
$disableIgnoredLines
= alse
$driver
private
PHP_CodeCoverage_Driver
$driver
$filter
private
PHP_CodeCoverage_Filter
$filter
$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
__construct()
Constructor.
public
__construct([PHP_CodeCoverage_Driver $driver = null ][, PHP_CodeCoverage_Filter $filter = null ]) : mixed
Parameters
- $driver : PHP_CodeCoverage_Driver = null
- $filter : PHP_CodeCoverage_Filter = null
Tags
Return values
mixed —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
Return values
mixed —clear()
Clears collected code coverage data.
public
clear() : mixed
Return values
mixed —filter()
Returns the PHP_CodeCoverage_Filter used.
public
filter() : PHP_CodeCoverage_Filter
Return values
PHP_CodeCoverage_Filter —getCacheTokens()
public
getCacheTokens() : mixed
Tags
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
Return values
array<string|int, mixed> —getReport()
Returns the PHP_CodeCoverage_Report_Node_* object graph for this PHP_CodeCoverage object.
public
getReport() : PHP_CodeCoverage_Report_Node_Directory
Tags
Return values
PHP_CodeCoverage_Report_Node_Directory —getTests()
Returns the test data.
public
getTests() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —merge()
Merges the data from another instance of PHP_CodeCoverage.
public
merge(PHP_CodeCoverage $that) : mixed
Parameters
- $that : PHP_CodeCoverage
Return values
mixed —setAddUncoveredFilesFromWhitelist()
public
setAddUncoveredFilesFromWhitelist(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —setCacheTokens()
public
setCacheTokens(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —setCheckForUnintentionallyCoveredCode()
public
setCheckForUnintentionallyCoveredCode(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —setData()
Sets the coverage data.
public
setData(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Tags
Return values
mixed —setDisableIgnoredLines()
public
setDisableIgnoredLines(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —setForceCoversAnnotation()
public
setForceCoversAnnotation(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —setMapTestClassNameToCoveredClassName()
public
setMapTestClassNameToCoveredClassName(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —setProcessUncoveredFilesFromWhitelist()
public
setProcessUncoveredFilesFromWhitelist(bool $flag) : mixed
Parameters
- $flag : bool
Tags
Return values
mixed —setTests()
Sets the test data.
public
setTests(array<string|int, mixed> $tests) : mixed
Parameters
- $tests : array<string|int, mixed>
Tags
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
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
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
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
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
Return values
array<string|int, mixed> —initializeFilesThatAreSeenTheFirstTime()
private
initializeFilesThatAreSeenTheFirstTime(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Tags
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
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 —selectDriver()
private
selectDriver() : PHP_CodeCoverage_Driver