src/Reporter/Coverage/Metrics.php
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);
    }
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);
    }
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 ) ; }
Merges some given metrics to the existing metrics .

@param array   $metrics Metrics data to merge.
@param boolean $line    Set to `true` for function only
Merges some given metrics to the existing metrics .