PHP Класс Kahlan\Reporter\Coverage\Collector

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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

Открытые методы

Метод Описание
__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 ( ) : 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.

Защищенные методы

Метод Описание
_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().

Описание методов

__construct() публичный Метод

The Constructor.
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.

_coverage() защищенный Метод

Helper for Collector::addFile().
protected _coverage ( string $file, array $coverage )
$file string A file path.
$coverage array Some coverage related to the file path.

_lineMetric() защищенный Метод

Helper for Collector::metrics().
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.
Результат integer The metric value.

_methodMetrics() защищенный Метод

Helper for Collector::metrics().
protected _methodMetrics ( object $node, array $metrics ) : array
$node object The node to collect metrics on.
$metrics array The metrics of the node.
Результат array The updated metrics.

_processMetrics() защищенный Метод

Helper for Collector::metrics().
protected _processMetrics ( string $file, object $node, array $coverage ) : array
$file string The processed file.
$node object The node to collect metrics on.
$coverage array The coverage data.
Результат array The collected metrics.

_processNode() защищенный Метод

Helper for Collector::metrics().
protected _processNode ( string $file, object $node, array $coverage, string $path )
$file string The processed file.
$node object The node to collect metrics on.
$coverage array The coverage data.
$path string The naming of the processed node.

_processTree() защищенный Метод

Helper for Collector::metrics().
protected _processTree ( string $file, object $nodes, array $coverage, string $path = '' )
$file string The processed file.
$nodes object The nodes to collect metrics on.
$coverage array The coverage data.
$path string The naming of the processed node.

add() публичный Метод

Adds some coverage data to the collector.
public add ( array $coverage ) : array
$coverage array Some coverage data.
Результат array The current coverage data.

addFile() публичный Метод

Adds some coverage data to the collector.
public addFile ( string $file, array $coverage )
$file string A file path.
$coverage array Some coverage related to the file path.

base() публичный Метод

Gets the base path used to compute relative paths.
public base ( ) : string
Результат string

collectable() публичный Метод

Checks if a filename is collectable.
public collectable ( string $file ) : boolean
$file string A file path.
Результат boolean

driver() публичный Метод

Gets the used driver.
public driver ( ) : object
Результат object

export() публичный Метод

Exports coverage data.
public export ( $file = null ) : array
Результат array The coverage data.

metrics() публичный Метод

Gets the collected metrics from coverage data.
public metrics ( ) : Metrics
Результат Metrics The collected metrics.

parse() публичный Метод

Retruns & cache the tree structure of a file.
public parse ( string $file )
$file string the file path to use for building the tree structure.

realpath() публичный Метод

Gets the real path in the original src directory.
public realpath ( string $file ) : string
$file string A file path or cached file path.
Результат string The original file path.

start() публичный Метод

Starts collecting coverage data.
public start ( ) : boolean
Результат boolean

stop() публичный Метод

Stops collecting coverage data.
public stop ( $mergeToParent = true ) : boolean
Результат boolean

Описание свойств

$_classes защищенное свойство

Class dependencies.
protected array $_classes
Результат array

$_collectors защищенное статическое свойство

Stack of active collectors.
protected static array $_collectors
Результат array

$_coverage защищенное свойство

The coverage data.
protected array $_coverage
Результат array

$_driver защищенное свойство

The driver instance which will log the coverage data.
protected object $_driver
Результат object

$_files защищенное свойство

The files presents in Collector::_paths.
protected array $_files
Результат array

$_metrics защищенное свойство

The metrics.
protected array $_metrics
Результат array

$_paths защищенное свойство

The path(s) which contain the code source files.
protected array $_paths
Результат array

$_prefix защищенное свойство

Some prefix to remove to get the real file path.
protected string $_prefix
Результат string

$_processed защищенное свойство

Temps cache of processed lines
protected array $_processed
Результат array

$_tree защищенное свойство

Cache all parsed files
protected array $_tree
Результат array