PHP_CodeCoverage_Report_Factory
in package
Factory for PHP_CodeCoverage_Report_Node_* object graphs.
Tags
Table of Contents
- create() : PHP_CodeCoverage_Report_Node_Directory
- addItems() : mixed
- buildDirectoryStructure() : array<string|int, mixed>
- Builds an array representation of the directory structure.
- reducePaths() : string
- Reduces the paths by cutting the longest common start path.
Methods
create()
public
create(PHP_CodeCoverage $coverage) : PHP_CodeCoverage_Report_Node_Directory
Parameters
- $coverage : PHP_CodeCoverage
Return values
PHP_CodeCoverage_Report_Node_Directory —addItems()
private
addItems(PHP_CodeCoverage_Report_Node_Directory $root, array<string|int, mixed> $items, array<string|int, mixed> $tests, bool $cacheTokens) : mixed
Parameters
- $root : PHP_CodeCoverage_Report_Node_Directory
- $items : array<string|int, mixed>
- $tests : array<string|int, mixed>
- $cacheTokens : bool
Return values
mixed —buildDirectoryStructure()
Builds an array representation of the directory structure.
private
buildDirectoryStructure(array<string|int, mixed> $files) : array<string|int, mixed>
For instance,
Array
(
[Money.php] => Array
(
...
)
[MoneyBag.php] => Array
(
...
)
)
is transformed into
Array
(
[.] => Array
(
[Money.php] => Array
(
...
)
[MoneyBag.php] => Array
(
...
)
)
)
Parameters
- $files : array<string|int, mixed>
Return values
array<string|int, mixed> —reducePaths()
Reduces the paths by cutting the longest common start path.
private
reducePaths(array<string|int, mixed> &$files) : string
For instance,
Array
(
[/home/sb/Money/Money.php] => Array
(
...
)
[/home/sb/Money/MoneyBag.php] => Array
(
...
)
)
is reduced to
Array
(
[Money.php] => Array
(
...
)
[MoneyBag.php] => Array
(
...
)
)
Parameters
- $files : array<string|int, mixed>