CodeCoverage
in package
FinalYes
Provides collection functionality for PHP code coverage information.
Tags
Table of Contents
Constants
- UNCOVERED_FILES = 'UNCOVERED_FILES'
Properties
- $analyser : FileAnalyser|null
- $cacheDirectory : string|null
- $cachedReport : Directory|null
- $checkForUnintentionallyCoveredCode : bool
- $currentId : string|null
- $currentSize : TestSize|null
- $data : ProcessedCodeCoverageData
- $driver : Driver
- $filter : Filter
- $ignoreDeprecatedCode : bool
- $includeUncoveredFiles : bool
- $linesToBeIgnored : array<string|int, mixed>
- $parentClassesExcludedFromUnintentionallyCoveredCodeCheck : array<string|int, mixed>
- $tests : array<string|int, mixed>
- $useAnnotationsForIgnoringCode : bool
- $wizard : Wizard
Methods
- __construct() : mixed
- append() : void
- cacheDirectory() : string
- cachesStaticAnalysis() : bool
- cacheStaticAnalysis() : void
- clear() : void
- Clears collected code coverage data.
- collectsBranchAndPathCoverage() : bool
- detectsDeadCode() : bool
- disableAnnotationsForIgnoringCode() : void
- disableBranchAndPathCoverage() : void
- disableCheckForUnintentionallyCoveredCode() : void
- doNotCacheStaticAnalysis() : void
- doNotIgnoreDeprecatedCode() : void
- enableAnnotationsForIgnoringCode() : void
- enableBranchAndPathCoverage() : void
- enableCheckForUnintentionallyCoveredCode() : void
- excludeSubclassesOfThisClassFromUnintentionallyCoveredCodeCheck() : void
- excludeUncoveredFiles() : void
- filter() : Filter
- Returns the filter object used.
- getData() : ProcessedCodeCoverageData
- Returns the collected code coverage data.
- getReport() : Directory
- Returns the code coverage information as a graph of node objects.
- getTests() : array<string|int, mixed>
- ignoreDeprecatedCode() : void
- includeUncoveredFiles() : void
- merge() : void
- Merges the data from another instance.
- setData() : void
- Sets the coverage data.
- setTests() : void
- start() : void
- stop() : RawCodeCoverageData
- addUncoveredFilesFromFilter() : void
- analyser() : FileAnalyser
- applyCoversAndUsesFilter() : void
- applyExecutableLinesFilter() : void
- applyFilter() : void
- applyIgnoredLinesFilter() : void
- getAllowedLines() : array<string|int, mixed>
- performUnintentionallyCoveredCodeCheck() : void
- processUnintentionallyCoveredUnits() : array<int, string>
Constants
UNCOVERED_FILES
private
mixed
UNCOVERED_FILES
= 'UNCOVERED_FILES'
Properties
$analyser
private
FileAnalyser|null
$analyser
= null
$cacheDirectory
private
string|null
$cacheDirectory
= null
$cachedReport
private
Directory|null
$cachedReport
= null
$checkForUnintentionallyCoveredCode
private
bool
$checkForUnintentionallyCoveredCode
= false
$currentId
private
string|null
$currentId
= null
$currentSize
private
TestSize|null
$currentSize
= null
$data
private
ProcessedCodeCoverageData
$data
$driver read-only
private
Driver
$driver
$filter read-only
private
Filter
$filter
$ignoreDeprecatedCode
private
bool
$ignoreDeprecatedCode
= false
$includeUncoveredFiles
private
bool
$includeUncoveredFiles
= true
$linesToBeIgnored
private
array<string|int, mixed>
$linesToBeIgnored
= []
Tags
$parentClassesExcludedFromUnintentionallyCoveredCodeCheck
private
array<string|int, mixed>
$parentClassesExcludedFromUnintentionallyCoveredCodeCheck
= []
Tags
$tests
private
array<string|int, mixed>
$tests
= []
Tags
$useAnnotationsForIgnoringCode
private
bool
$useAnnotationsForIgnoringCode
= true
$wizard read-only
private
Wizard
$wizard
Methods
__construct()
public
__construct(Driver $driver, Filter $filter) : mixed
Parameters
- $driver : Driver
- $filter : Filter
append()
public
append(RawCodeCoverageData $rawData[, string|null $id = null ][, bool $append = true ][, TestStatus|null $status = null ][, array<string|int, mixed>|false $linesToBeCovered = [] ][, array<string|int, mixed> $linesToBeUsed = [] ][, array<string|int, mixed> $linesToBeIgnored = [] ]) : void
Parameters
- $rawData : RawCodeCoverageData
- $id : string|null = null
- $append : bool = true
- $status : TestStatus|null = null
- $linesToBeCovered : array<string|int, mixed>|false = []
- $linesToBeUsed : array<string|int, mixed> = []
- $linesToBeIgnored : array<string|int, mixed> = []
Tags
cacheDirectory()
public
cacheDirectory() : string
Tags
Return values
stringcachesStaticAnalysis()
public
cachesStaticAnalysis() : bool
Tags
Return values
boolcacheStaticAnalysis()
public
cacheStaticAnalysis(string $directory) : void
Parameters
- $directory : string
clear()
Clears collected code coverage data.
public
clear() : void
collectsBranchAndPathCoverage()
public
collectsBranchAndPathCoverage() : bool
Return values
booldetectsDeadCode()
public
detectsDeadCode() : bool
Return values
booldisableAnnotationsForIgnoringCode()
public
disableAnnotationsForIgnoringCode() : void
disableBranchAndPathCoverage()
public
disableBranchAndPathCoverage() : void
disableCheckForUnintentionallyCoveredCode()
public
disableCheckForUnintentionallyCoveredCode() : void
doNotCacheStaticAnalysis()
public
doNotCacheStaticAnalysis() : void
doNotIgnoreDeprecatedCode()
public
doNotIgnoreDeprecatedCode() : void
enableAnnotationsForIgnoringCode()
public
enableAnnotationsForIgnoringCode() : void
enableBranchAndPathCoverage()
public
enableBranchAndPathCoverage() : void
enableCheckForUnintentionallyCoveredCode()
public
enableCheckForUnintentionallyCoveredCode() : void
excludeSubclassesOfThisClassFromUnintentionallyCoveredCodeCheck()
public
excludeSubclassesOfThisClassFromUnintentionallyCoveredCodeCheck(string $className) : void
Parameters
- $className : string
Tags
excludeUncoveredFiles()
public
excludeUncoveredFiles() : void
filter()
Returns the filter object used.
public
filter() : Filter
Return values
FiltergetData()
Returns the collected code coverage data.
public
getData([bool $raw = false ]) : ProcessedCodeCoverageData
Parameters
- $raw : bool = false
Return values
ProcessedCodeCoverageDatagetReport()
Returns the code coverage information as a graph of node objects.
public
getReport() : Directory
Return values
DirectorygetTests()
public
getTests() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>ignoreDeprecatedCode()
public
ignoreDeprecatedCode() : void
includeUncoveredFiles()
public
includeUncoveredFiles() : void
merge()
Merges the data from another instance.
public
merge(self $that) : void
Parameters
- $that : self
setData()
Sets the coverage data.
public
setData(ProcessedCodeCoverageData $data) : void
Parameters
- $data : ProcessedCodeCoverageData
setTests()
public
setTests(array<string|int, mixed> $tests) : void
Parameters
- $tests : array<string|int, mixed>
Tags
start()
public
start(string $id[, TestSize|null $size = null ][, bool $clear = false ]) : void
Parameters
- $id : string
- $size : TestSize|null = null
- $clear : bool = false
stop()
public
stop([bool $append = true ][, TestStatus|null $status = null ][, array<string|int, mixed>|false $linesToBeCovered = [] ][, array<string|int, mixed> $linesToBeUsed = [] ][, array<string|int, mixed> $linesToBeIgnored = [] ]) : RawCodeCoverageData
Parameters
- $append : bool = true
- $status : TestStatus|null = null
- $linesToBeCovered : array<string|int, mixed>|false = []
- $linesToBeUsed : array<string|int, mixed> = []
- $linesToBeIgnored : array<string|int, mixed> = []
Tags
Return values
RawCodeCoverageDataaddUncoveredFilesFromFilter()
private
addUncoveredFilesFromFilter() : void
Tags
analyser()
private
analyser() : FileAnalyser
Return values
FileAnalyserapplyCoversAndUsesFilter()
private
applyCoversAndUsesFilter(RawCodeCoverageData $rawData, array<string|int, mixed>|false $linesToBeCovered, array<string|int, mixed> $linesToBeUsed, TestSize $size) : void
Parameters
- $rawData : RawCodeCoverageData
- $linesToBeCovered : array<string|int, mixed>|false
- $linesToBeUsed : array<string|int, mixed>
- $size : TestSize
Tags
applyExecutableLinesFilter()
private
applyExecutableLinesFilter(RawCodeCoverageData $data) : void
Parameters
- $data : RawCodeCoverageData
applyFilter()
private
applyFilter(RawCodeCoverageData $data) : void
Parameters
- $data : RawCodeCoverageData
applyIgnoredLinesFilter()
private
applyIgnoredLinesFilter(RawCodeCoverageData $data, array<string|int, mixed> $linesToBeIgnored) : void
Parameters
- $data : RawCodeCoverageData
- $linesToBeIgnored : array<string|int, mixed>
Tags
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>
Return values
array<string|int, mixed>performUnintentionallyCoveredCodeCheck()
private
performUnintentionallyCoveredCodeCheck(RawCodeCoverageData $data, array<string|int, mixed> $linesToBeCovered, array<string|int, mixed> $linesToBeUsed) : void
Parameters
- $data : RawCodeCoverageData
- $linesToBeCovered : array<string|int, mixed>
- $linesToBeUsed : array<string|int, mixed>
Tags
processUnintentionallyCoveredUnits()
private
processUnintentionallyCoveredUnits(array<int, string> $unintentionallyCoveredUnits) : array<int, string>
Parameters
- $unintentionallyCoveredUnits : array<int, string>