phplinter\Report\Html::output_indexes PHP Method

output_indexes() protected method

----------------------------------------------------------------------+
protected output_indexes ( $urls, $penaltys, $path = '', $depth ) : Array
$urls Array
$penaltys Array
$path String
$depth int
return Array ----------------------------------------------------------------------+
    protected function output_indexes($urls, $penaltys, $path = '', $depth = 0)
    {
        $out = '<div class="wrapper"><table border="1" cellpadding="0" cellspacing="0">';
        $out .= '<tr><td align="center">' . date("d / M / Y") . '</td>';
        $out .= '<td colspan="2" align="center">' . $this->root . '</td></tr>';
        $content = '';
        $total = 0;
        $num = 0;
        foreach ($urls as $k => $_) {
            $content .= '<tr>';
            if (isset($_['phplinter___file'])) {
                $score = SCORE_FULL + $penaltys[$_['phplinter___file']];
                $total += $score;
                $num++;
                $class = $this->get_score_class($score);
                $content .= '<td class="' . $class . '">' . sprintf('%.2f', $score) . '</td>';
                $limit = $score == 10 ? 'perfect' : 'limit';
                $content .= '<td class="' . $limit . '">' . sprintf('%.2f', SCORE_FULL) . '</td>';
                $content .= '<td><a href="' . $_['phplinter___url'] . '">' . mb_substr(realpath($_['phplinter___file']), mb_strlen($this->root . $path)) . '</a></td>';
            } else {
                list($ototal, $onum) = $this->output_indexes($urls[$k], $penaltys, $path . $k . '/', $depth + 1);
                $avarage = $ototal / $onum;
                $class = $this->get_score_class($avarage);
                $content .= sprintf('<td colspan="2" class="%s">Average: %.2f</td>', $class, $avarage);
                $content .= '<td class="folder"><a href="' . $k . '">' . $k . '</a></td>';
                $total += $ototal;
                $num += $onum;
            }
            $content .= '</tr>';
        }
        $out .= '<tr>';
        $avarage = $total / $num;
        $class = $this->get_score_class($avarage);
        $out .= sprintf('<td colspan="2" align="center" class="%s">Average: %.2f</td>', $class, $avarage);
        $out .= '<td>' . $path . '</td>';
        $out .= '</tr>';
        $out .= $content;
        $out .= '</table></div>';
        $path = $path == '/' ? $this->html['out'] : $path;
        $dir = $path == $this->html['out'] ? $path : rtrim($this->html['out'], '/') . $path;
        $dir = rtrim($dir, '/') . '/';
        if (!empty($path)) {
            $file = $dir . 'index.html';
            $this->write($file, $this->_html($out, $depth));
        }
        $this->dirs[] = $dir;
        return array($total, $num);
    }