Kahlan\Reporter\Coverage\Metrics::_merge PHP 메소드

_merge() 보호된 메소드

Merges some given metrics to the existing metrics .
protected _merge ( array $metrics = [], boolean $line = false )
$metrics array Metrics data to merge.
$line boolean Set to `true` for function only
    protected function _merge($metrics = [], $line = false)
    {
        $defaults = ['loc' => [], 'nlloc' => [], 'lloc' => [], 'cloc' => [], 'files' => [], 'methods' => 0, 'cmethods' => 0];
        $metrics += $defaults;
        foreach (['loc', 'nlloc', 'lloc', 'cloc', 'coverage', 'files', 'methods', 'cmethods'] as $name) {
            $metrics[$name] += $this->_metrics[$name];
        }
        if (!$line) {
            unset($metrics['line']);
        }
        $this->data($metrics);
    }