Console   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A printResults() 0 16 3
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
}