Property | Type | Description | |
---|---|---|---|
$_classes | array | Class dependencies. | |
$_collectors | array | Stack of active collectors. | |
$_coverage | array | The coverage data. | |
$_driver | object | The driver instance which will log the coverage data. | |
$_files | array | The files presents in Collector::_paths. | |
$_metrics | array | The metrics. | |
$_paths | array | The path(s) which contain the code source files. | |
$_prefix | string | Some prefix to remove to get the real file path. | |
$_processed | array | Temps cache of processed lines | |
$_tree | array | Cache all parsed files |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) | The Constructor. | |
add ( array $coverage ) : array | Adds some coverage data to the collector. | |
addFile ( string $file, array $coverage ) | Adds some coverage data to the collector. | |
base ( ) : string | Gets the base path used to compute relative paths. | |
collectable ( string $file ) : boolean | Checks if a filename is collectable. | |
driver ( ) : object | Gets the used driver. | |
export ( $file = null ) : array | Exports coverage data. | |
metrics ( ) : |
Gets the collected metrics from coverage data. | |
parse ( string $file ) | Retruns & cache the tree structure of a file. | |
realpath ( string $file ) : string | Gets the real path in the original src directory. | |
start ( ) : boolean | Starts collecting coverage data. | |
stop ( $mergeToParent = true ) : boolean | Stops collecting coverage data. |
Method | Description | |
---|---|---|
_coverage ( string $file, array $coverage ) | Helper for Collector::addFile(). | |
_lineMetric ( string $type, integer $index, integer $value, integer $increment = 1 ) : integer | Helper for Collector::metrics(). | |
_methodMetrics ( object $node, array $metrics ) : array | Helper for Collector::metrics(). | |
_processMetrics ( string $file, object $node, array $coverage ) : array | Helper for Collector::metrics(). | |
_processNode ( string $file, object $node, array $coverage, string $path ) | Helper for Collector::metrics(). | |
_processTree ( string $file, object $nodes, array $coverage, string $path = '' ) | Helper for Collector::metrics(). |
public __construct ( array $config = [] ) | ||
$config | array | Possible options values are: - `'driver'` _object_: the driver instance which will log the coverage data. - `'path'` _array_ : the path(s) which contain the code source files. - `'base'` _string_: the base path of the repo (default: `getcwd`). - `'prefix'` _string_: some prefix to remove to get the real file path. |
protected _lineMetric ( string $type, integer $index, integer $value, integer $increment = 1 ) : integer | ||
$type | string | The metric type. |
$index | integer | The line index. |
$value | integer | The value to update. |
$increment | integer | The increment to perform if the line has not already been processed. |
return | integer | The metric value. |
public collectable ( string $file ) : boolean | ||
$file | string | A file path. |
return | boolean |
public metrics ( ) : |
||
return | The collected metrics. |
protected static array $_collectors | ||
return | array |
protected object $_driver | ||
return | object |
protected array $_files | ||
return | array |
protected array $_paths | ||
return | array |
protected string $_prefix | ||
return | string |
protected array $_processed | ||
return | array |