Kahlan\Reporter\Coverage\Metrics::data PHP Méthode

data() public méthode

Gets/Sets the metrics stats.
public data ( array $metrics = [] ) : array
$metrics array The metrics data to set if defined.
Résultat array The metrics data.
    public function data($metrics = [])
    {
        if (func_num_args() === 0) {
            return $this->_metrics;
        }
        $this->_metrics = $metrics + $this->_metrics;
        if ($this->_metrics['lloc']) {
            $this->_metrics['percent'] = $this->_metrics['cloc'] * 100 / $this->_metrics['lloc'];
        } else {
            $this->_metrics['percent'] = 100;
        }
    }