ResultPrinter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 2
A flush() 0 6 2
1
<?php
2
/**
3
 * @link https://github.com/vuongxuongminh/yii2-mfa
4
 * @copyright Copyright (c) 2019 Vuong Xuong Minh
5
 * @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
6
 */
7
8
namespace vxm\test\unit\desktopNotifier;
9
10
use PHPUnit\TextUI\ResultPrinter as BaseResultPrinter;
11
12
/**
13
 * Class ResultPrinter overrides \PHPUnit\TextUI\ResultPrinter constructor
14
 * to change default output to STDOUT and prevent some tests from fail when
15
 * they can not be executed after headers have been sent.
16
 *
17
 * @see https://github.com/yiisoft/yii2/blob/master/tests/ResultPrinter.php
18
 */
19
class ResultPrinter extends BaseResultPrinter
20
{
21
    public function __construct(
22
        $out = null,
23
        $verbose = false,
24
        $colors = \PHPUnit\TextUI\ResultPrinter::COLOR_DEFAULT,
25
        $debug = false,
26
        $numberOfColumns = 80,
27
        $reverse = false
28
    )
29
    {
30
        if ($out === null) {
31
            $out = STDOUT;
32
        }
33
        parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns, $reverse);
34
    }
35
36
    public function flush(): void
37
    {
38
        if ($this->out !== STDOUT) {
39
            parent::flush();
40
        }
41
    }
42
}
43