public function output()
    {
        $data = [
            'classes' => [],
            'files'   => [],
        ];
        foreach ($this->processed as $type => $classes) {
            foreach ($classes as $name => $values) {
                $covered = $values['covered'];
                $total   = $values['total'];
                $pct     = (((int) $covered / (int) $total) * 100);

                $covered    = str_pad((string) $covered, 7, ' ', STR_PAD_LEFT);
                $total      = str_pad((string) $total, 5, ' ', STR_PAD_LEFT);
                $percentage = number_format($pct, 2).'%';
                $percentage = str_pad((string) $percentage, 10, ' ', STR_PAD_LEFT);

                if ($pct < 25) {
                    $covered    = $this->output->red($covered);
                    $total      = $this->output->red($total);
                    $percentage = $this->output->red($percentage);
                }

                if ($pct < 75) {
                    $covered    = $this->output->black->yellow($covered);
                    $total      = $this->output->black->yellow($total);
                    $percentage = $this->output->black->yellow($percentage);
                }

                if ($pct >= 75) {
                    $covered    = $this->output->green($covered);
                    $total      = $this->output->green($total);
                    $percentage = $this->output->green($percentage);
                }

                $data[$type][] = [$name, $covered, $total, $percentage];
            }
        }

        $out = [];
        if (count($data['classes']) > 0) {
            array_unshift($data['classes'], ['Class', 'Covered', 'Lines', 'Percentage']);

            $out[] = new Table($data['classes'], [
                'headerColor'     => Graphite::YELLOW,
                'columnSeparator' => '',
                'headerSeparator' => '',
                'cellPadding'     => 1,
            ]);
        }

        if (count($data['files']) > 0) {
            array_unshift($data['files'], ['File', 'Covered', 'Lines', 'Percentage']);

            $out[] = new Table($data['files'], [
                'headerColor'     => Graphite::YELLOW,
                'columnSeparator' => '',
                'headerSeparator' => '',
                'cellPadding'     => 1,
            ]);
        }

        return $this->output->render(implode("\n\n", $out));
    }
public function output()
    {
        $data = [
            'classes' => [],
            'files'   => [],
        ];
        foreach ($this->processed as $type => $classes) {
            foreach ($classes as $name => $values) {
                $covered = $values['covered'];
                $total   = $values['total'];
                $pct     = (((int) $covered / (int) $total) * 100);

                $covered    = str_pad((string) $covered, 7, ' ', STR_PAD_LEFT);
                $total      = str_pad((string) $total, 5, ' ', STR_PAD_LEFT);
                $percentage = number_format($pct, 2).'%';
                $percentage = str_pad((string) $percentage, 10, ' ', STR_PAD_LEFT);

                if ($pct < 25) {
                    $covered    = $this->output->red($covered);
                    $total      = $this->output->red($total);
                    $percentage = $this->output->red($percentage);
                }

                if ($pct < 75) {
                    $covered    = $this->output->black->yellow($covered);
                    $total      = $this->output->black->yellow($total);
                    $percentage = $this->output->black->yellow($percentage);
                }

                if ($pct >= 75) {
                    $covered    = $this->output->green($covered);
                    $total      = $this->output->green($total);
                    $percentage = $this->output->green($percentage);
                }

                $data[$type][] = [$name, $covered, $total, $percentage];
            }
        }

        $out = [];
        if (count($data['classes']) > 0) {
            array_unshift($data['classes'], ['Class', 'Covered', 'Lines', 'Percentage']);

            $out[] = new Table($data['classes'], [
                'headerColor'     => Graphite::YELLOW,
                'columnSeparator' => '',
                'headerSeparator' => '',
                'cellPadding'     => 1,
            ]);
        }

        if (count($data['files']) > 0) {
            array_unshift($data['files'], ['File', 'Covered', 'Lines', 'Percentage']);

            $out[] = new Table($data['files'], [
                'headerColor'     => Graphite::YELLOW,
                'columnSeparator' => '',
                'headerSeparator' => '',
                'cellPadding'     => 1,
            ]);
        }

        return $this->output->render(implode("\n\n", $out));
    }
public function output ( ) { $ data = [ 'classes' => [ ] , 'files' => [ ] , ] ; foreach ( $ this -> processed as $ type => $ classes ) { foreach ( $ classes as $ name => $ values ) { $ covered = $ values [ 'covered' ] ; $ total = $ values [ 'total' ] ; $ pct = ( ( ( int ) $ covered / ( int ) $ total ) * 100 ) ; $ covered = str_pad ( ( string ) $ covered , 7 , ' ' , STR_PAD_LEFT ) ; $ total = str_pad ( ( string ) $ total , 5 , ' ' , STR_PAD_LEFT ) ; $ percentage = number_format ( $ pct , 2 ) . '%' ; $ percentage = str_pad ( ( string ) $ percentage , 10 , ' ' , STR_PAD_LEFT ) ; if ( $ pct < 25 ) { $ covered = $ this -> output -> red ( $ covered ) ; $ total = $ this -> output -> red ( $ total ) ; $ percentage = $ this -> output -> red ( $ percentage ) ; } if ( $ pct < 75 ) { $ covered = $ this -> output -> black -> yellow ( $ covered ) ; $ total = $ this -> output -> black -> yellow ( $ total ) ; $ percentage = $ this -> output -> black -> yellow ( $ percentage ) ; } if ( $ pct >= 75 ) { $ covered = $ this -> output -> green ( $ covered ) ; $ total = $ this -> output -> green ( $ total ) ; $ percentage = $ this -> output -> green ( $ percentage ) ; } $ data [ $ type ] [ ] = [ $ name , $ covered , $ total , $ percentage ] ; } } $ out = [ ] ; if ( count ( $ data [ 'classes' ] ) > 0 ) { array_unshift ( $ data [ 'classes' ] , [ 'Class' , 'Covered' , 'Lines' , 'Percentage' ] ) ; $ out [ ] = new Table ( $ data [ 'classes' ] , [ 'headerColor' => Graphite :: YELLOW , 'columnSeparator' => '' , 'headerSeparator' => '' , 'cellPadding' => 1 , ] ) ; } if ( count ( $ data [ 'files' ] ) > 0 ) { array_unshift ( $ data [ 'files' ] , [ 'File' , 'Covered' , 'Lines' , 'Percentage' ] ) ; $ out [ ] = new Table ( $ data [ 'files' ] , [ 'headerColor' => Graphite :: YELLOW , 'columnSeparator' => '' , 'headerSeparator' => '' , 'cellPadding' => 1 , ] ) ; } return $ this -> output -> render ( implode ( "\n\n" , $ out ) ) ; }
Output the coverage tables.

@return string The rendered tables
Output the coverage tables .