Completed
Push — master ( 7195f8...c1e355 )
by Bill
10s
created

ConsoleResultsRenderer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 15 1
1
<?php declare(strict_types = 1);
2
3
4
namespace Churn\Renderers\Results;
5
6
use Churn\Results\ResultCollection;
7
use Symfony\Component\Console\Helper\Table;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class ConsoleResultsRenderer implements ResultsRendererInterface
11
{
12
    /**
13
     * Renders the results.
14
     * @param OutputInterface  $output  Output Interface.
15
     * @param ResultCollection $results Result Collection.
16
     * @return void
17
     */
18
    public function render(OutputInterface $output, ResultCollection $results)
19
    {
20
        echo "\n
21
    ___  _   _  __  __  ____  _  _     ____  _   _  ____
22
   / __)( )_( )(  )(  )(  _ \( \( )___(  _ \( )_( )(  _ \
23
  ( (__  ) _ (  )(__)(  )   / )  ((___))___/ ) _ (  )___/
24
   \___)(_) (_)(______)(_)\_)(_)\_)   (__)  (_) (_)(__)      https://github.com/bmitch/churn-php\n\n";
25
26
        $table = new Table($output);
27
        $table->setHeaders(['File', 'Times Changed', 'Complexity', 'Score']);
28
        $table->addRows($results->toArray());
29
30
        $table->render();
31
        echo "\n";
32
    }
33
}
34