ConsoleResultsRenderer::render()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Churn\Result\Render;
6
7
use Symfony\Component\Console\Helper\Table;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * @internal
12
 */
13
final class ConsoleResultsRenderer implements ResultsRendererInterface
14
{
15
    /**
16
     * Renders the results.
17
     *
18
     * @param OutputInterface $output Output Interface.
19
     * @param array<array<float|integer|string>> $results The results.
20
     */
21
    #[\Override]
22
    public function render(OutputInterface $output, array $results): void
23
    {
24
        $table = new Table($output);
25
        $table->setHeaders(['File', 'Times Changed', 'Complexity', 'Score']);
26
        $table->addRows($results);
27
        $table->render();
28
    }
29
}
30