GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ConsoleOutput   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A hasStdoutSupport() 0 4 1
1
<?php
2
/**
3
 * See class comment
4
 *
5
 * PHP Version 5
6
 *
7
 * @category Netresearch
8
 * @package  Netresearch\Kite\Console\Output
9
 * @author   Christian Opitz <[email protected]>
10
 * @license  http://www.netresearch.de Netresearch Copyright
11
 * @link     http://www.netresearch.de
12
 */
13
14
namespace Netresearch\Kite\Console\Output;
15
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
16
17
/**
18
 * Class ConsoleOutput
19
 *
20
 * @category Netresearch
21
 * @package  Netresearch\Kite\Console\Output
22
 * @author   Christian Opitz <[email protected]>
23
 * @license  http://www.netresearch.de Netresearch Copyright
24
 * @link     http://www.netresearch.de
25
 */
26
class ConsoleOutput extends Output
27
{
28
    /**
29
     * ConsoleOutput constructor.
30
     *
31
     * @param int|mixed                     $verbosity The verbosity
32
     * @param boolean                       $decorated If output should be decorated
33
     * @param OutputFormatterInterface|null $formatter Formatter
34
     */
35
    public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
36
    {
37
        $outputStream = 'php://stdout';
38
        if (!$this->hasStdoutSupport()) {
39
            $outputStream = 'php://output';
40
        }
41
42
        parent::__construct(fopen($outputStream, 'w'), $verbosity, $decorated, $formatter);
43
    }
44
45
    /**
46
     * Returns true if current environment supports writing console output to
47
     * STDOUT.
48
     *
49
     * IBM iSeries (OS400) exhibits character-encoding issues when writing to
50
     * STDOUT and doesn't properly convert ASCII to EBCDIC, resulting in garbage
51
     * output.
52
     *
53
     * @return bool
54
     */
55
    protected function hasStdoutSupport()
56
    {
57
        return ('OS400' != php_uname('s'));
58
    }
59
}
60
?>
61