Passed
Push — master ( 554770...22aaff )
by Alexander
06:41
created

ResultPrinter::flush()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Yiisoft\Yii\Web\Tests;
4
5
/**
6
 * Class ResultPrinter overrides \PHPUnit\TextUI\ResultPrinter constructor
7
 * to change default output to STDOUT and prevent some tests from fail when
8
 * they can not be executed after headers have been sent.
9
 */
10
class ResultPrinter extends \PHPUnit\TextUI\ResultPrinter
11
{
12
    public function __construct(
13
        $out = null,
14
        $verbose = false,
15
        $colors = \PHPUnit\TextUI\ResultPrinter::COLOR_DEFAULT,
16
        $debug = false,
17
        $numberOfColumns = 80,
18
        $reverse = false
19
    ) {
20
        if ($out === null) {
21
            $out = STDOUT;
22
        }
23
24
        parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns, $reverse);
25
    }
26
27
    public function flush(): void
28
    {
29
        if ($this->out !== STDOUT) {
30
            parent::flush();
31
        }
32
    }
33
}
34