Console::printResults()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.7333
c 0
b 0
f 0
cc 3
nc 3
nop 0
1
<?php
2
3
namespace Lloople\PHPUnitExtensions\Runners\SlowestTests;
4
5
class Console extends Channel
6
{
7
8
    public function __construct(?int $rows = 5, ?int $min = 200)
9
    {
10
        parent::__construct($rows, $min);
11
    }
12
    
13
    protected function printResults(): void
14
    {
15
        $tests = $this->testsToPrint();
16
17
        if (count($tests) === 0) {
18
            return;
19
        }
20
21
        echo PHP_EOL . 'Slow tests detected: ' . PHP_EOL;
22
23
        foreach ($tests as $test => $time) {
24
            echo str_pad($time, 5, ' ', STR_PAD_LEFT) . " ms: {$test}" . PHP_EOL;
25
        }
26
27
        echo PHP_EOL;
28
    }
29
}