PHP_CodeCoverage_Report_Node_File
extends PHP_CodeCoverage_Report_Node
in package
Represents a file in the code coverage information tree.
Tags
Table of Contents
- $cacheTokens : bool
- $classes : array<string|int, mixed>
- $coverageData : array<string|int, mixed>
- $endLines : array<string|int, mixed>
- $functions : array<string|int, mixed>
- $id : string
- $linesOfCode : array<string|int, mixed>
- $name : string
- $numExecutableLines : int
- $numExecutedLines : int
- $numMethods : int
- $numTestedClasses : int
- $numTestedFunctions : int
- $numTestedMethods : int
- $numTestedTraits : int
- $parent : PHP_CodeCoverage_Report_Node
- $path : string
- $pathArray : array<string|int, mixed>
- $startLines : array<string|int, mixed>
- $testData : array<string|int, mixed>
- $traits : array<string|int, mixed>
- __construct() : mixed
- Constructor.
- count() : int
- Returns the number of files in/under this node.
- getClasses() : array<string|int, mixed>
- Returns the classes of this node.
- getClassesAndTraits() : array<string|int, mixed>
- Returns the classes and traits of this node.
- getCoverageData() : array<string|int, mixed>
- Returns the code coverage data of this node.
- getFunctions() : array<string|int, mixed>
- Returns the functions of this node.
- getId() : string
- getLineExecutedPercent() : int
- Returns the percentage of executed lines.
- getLinesOfCode() : array<string|int, mixed>
- Returns the LOC/CLOC/NCLOC of this node.
- getName() : string
- getNumClasses() : int
- Returns the number of classes.
- getNumClassesAndTraits() : int
- Returns the number of classes and traits.
- getNumExecutableLines() : int
- Returns the number of executable lines.
- getNumExecutedLines() : int
- Returns the number of executed lines.
- getNumFunctions() : int
- Returns the number of functions.
- getNumMethods() : int
- Returns the number of methods.
- getNumTestedClasses() : int
- Returns the number of tested classes.
- getNumTestedClassesAndTraits() : int
- Returns the number of tested classes and traits.
- getNumTestedFunctions() : int
- Returns the number of tested functions.
- getNumTestedMethods() : int
- Returns the number of tested methods.
- getNumTestedTraits() : int
- Returns the number of tested traits.
- getNumTraits() : int
- Returns the number of traits.
- getParent() : PHP_CodeCoverage_Report_Node
- getPath() : string
- getPathAsArray() : array<string|int, mixed>
- getTestData() : array<string|int, mixed>
- Returns the test data of this node.
- getTestedClassesAndTraitsPercent() : int
- Returns the percentage of traits that has been tested.
- getTestedClassesPercent() : int
- Returns the percentage of classes that has been tested.
- getTestedMethodsPercent() : int
- Returns the percentage of methods that has been tested.
- getTestedTraitsPercent() : int
- Returns the percentage of traits that has been tested.
- getTraits() : array<string|int, mixed>
- Returns the traits of this node.
- calculateStatistics() : mixed
- Calculates coverage statistics for the file.
- crap() : string
- Calculates the Change Risk Anti-Patterns (CRAP) index for a unit of code based on its cyclomatic complexity and percentage of code coverage.
- processClasses() : mixed
- processFunctions() : mixed
- processTraits() : mixed
Properties
$cacheTokens
protected
bool
$cacheTokens
$classes
protected
array<string|int, mixed>
$classes
= array()
$coverageData
protected
array<string|int, mixed>
$coverageData
$endLines
protected
array<string|int, mixed>
$endLines
= array()
$functions
protected
array<string|int, mixed>
$functions
= array()
$id
protected
string
$id
$linesOfCode
protected
array<string|int, mixed>
$linesOfCode
= array()
$name
protected
string
$name
$numExecutableLines
protected
int
$numExecutableLines
= 0
$numExecutedLines
protected
int
$numExecutedLines
= 0
$numMethods
protected
int
$numMethods
=
ull
$numTestedClasses
protected
int
$numTestedClasses
= 0
$numTestedFunctions
protected
int
$numTestedFunctions
=
ull
$numTestedMethods
protected
int
$numTestedMethods
=
ull
$numTestedTraits
protected
int
$numTestedTraits
= 0
$parent
protected
PHP_CodeCoverage_Report_Node
$parent
$path
protected
string
$path
$pathArray
protected
array<string|int, mixed>
$pathArray
$startLines
protected
array<string|int, mixed>
$startLines
= array()
$testData
protected
array<string|int, mixed>
$testData
$traits
protected
array<string|int, mixed>
$traits
= array()
Methods
__construct()
Constructor.
public
__construct(string $name, PHP_CodeCoverage_Report_Node $parent, array<string|int, mixed> $coverageData, array<string|int, mixed> $testData, bool $cacheTokens) : mixed
Parameters
- $name : string
- $parent : PHP_CodeCoverage_Report_Node
- $coverageData : array<string|int, mixed>
- $testData : array<string|int, mixed>
- $cacheTokens : bool
Tags
Return values
mixed —count()
Returns the number of files in/under this node.
public
count() : int
Return values
int —getClasses()
Returns the classes of this node.
public
getClasses() : array<string|int, mixed>
Return values
array<string|int, mixed> —getClassesAndTraits()
Returns the classes and traits of this node.
public
getClassesAndTraits() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getCoverageData()
Returns the code coverage data of this node.
public
getCoverageData() : array<string|int, mixed>
Return values
array<string|int, mixed> —getFunctions()
Returns the functions of this node.
public
getFunctions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getId()
public
getId() : string
Return values
string —getLineExecutedPercent()
Returns the percentage of executed lines.
public
getLineExecutedPercent([bool $asString = true ]) : int
Parameters
- $asString : bool = true
Return values
int —getLinesOfCode()
Returns the LOC/CLOC/NCLOC of this node.
public
getLinesOfCode() : array<string|int, mixed>
Return values
array<string|int, mixed> —getName()
public
getName() : string
Return values
string —getNumClasses()
Returns the number of classes.
public
getNumClasses() : int
Return values
int —getNumClassesAndTraits()
Returns the number of classes and traits.
public
getNumClassesAndTraits() : int
Tags
Return values
int —getNumExecutableLines()
Returns the number of executable lines.
public
getNumExecutableLines() : int
Return values
int —getNumExecutedLines()
Returns the number of executed lines.
public
getNumExecutedLines() : int
Return values
int —getNumFunctions()
Returns the number of functions.
public
getNumFunctions() : int
Return values
int —getNumMethods()
Returns the number of methods.
public
getNumMethods() : int
Return values
int —getNumTestedClasses()
Returns the number of tested classes.
public
getNumTestedClasses() : int
Return values
int —getNumTestedClassesAndTraits()
Returns the number of tested classes and traits.
public
getNumTestedClassesAndTraits() : int
Tags
Return values
int —getNumTestedFunctions()
Returns the number of tested functions.
public
getNumTestedFunctions() : int
Return values
int —getNumTestedMethods()
Returns the number of tested methods.
public
getNumTestedMethods() : int
Return values
int —getNumTestedTraits()
Returns the number of tested traits.
public
getNumTestedTraits() : int
Return values
int —getNumTraits()
Returns the number of traits.
public
getNumTraits() : int
Return values
int —getParent()
public
getParent() : PHP_CodeCoverage_Report_Node
Return values
PHP_CodeCoverage_Report_Node —getPath()
public
getPath() : string
Return values
string —getPathAsArray()
public
getPathAsArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —getTestData()
Returns the test data of this node.
public
getTestData() : array<string|int, mixed>
Return values
array<string|int, mixed> —getTestedClassesAndTraitsPercent()
Returns the percentage of traits that has been tested.
public
getTestedClassesAndTraitsPercent([bool $asString = true ]) : int
Parameters
- $asString : bool = true
Tags
Return values
int —getTestedClassesPercent()
Returns the percentage of classes that has been tested.
public
getTestedClassesPercent([bool $asString = true ]) : int
Parameters
- $asString : bool = true
Return values
int —getTestedMethodsPercent()
Returns the percentage of methods that has been tested.
public
getTestedMethodsPercent([bool $asString = true ]) : int
Parameters
- $asString : bool = true
Return values
int —getTestedTraitsPercent()
Returns the percentage of traits that has been tested.
public
getTestedTraitsPercent([bool $asString = true ]) : int
Parameters
- $asString : bool = true
Return values
int —getTraits()
Returns the traits of this node.
public
getTraits() : array<string|int, mixed>
Return values
array<string|int, mixed> —calculateStatistics()
Calculates coverage statistics for the file.
protected
calculateStatistics() : mixed
Return values
mixed —crap()
Calculates the Change Risk Anti-Patterns (CRAP) index for a unit of code based on its cyclomatic complexity and percentage of code coverage.
protected
crap(int $ccn, float $coverage) : string
Parameters
- $ccn : int
- $coverage : float
Tags
Return values
string —processClasses()
protected
processClasses(PHP_Token_Stream $tokens) : mixed
Parameters
- $tokens : PHP_Token_Stream
Return values
mixed —processFunctions()
protected
processFunctions(PHP_Token_Stream $tokens) : mixed
Parameters
- $tokens : PHP_Token_Stream
Return values
mixed —processTraits()
protected
processTraits(PHP_Token_Stream $tokens) : mixed
Parameters
- $tokens : PHP_Token_Stream