Completed
Branch output_parsers_refactor (d2cb12)
by Alessandro
02:20
created

ConsoleOutputStub   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 4
c 3
b 1
f 1
lcom 1
cbo 1
dl 0
loc 36
rs 10
1
<?php
2
3
namespace Paraunit\Tests\Stub;
4
5
use Symfony\Component\Console\Output\ConsoleOutput;
6
use Symfony\Component\Console\Output\OutputInterface;
7
8
/**
9
 * Class QueueConsoleOutput.
10
 */
11
class ConsoleOutputStub extends ConsoleOutput implements OutputInterface
12
{
13
    protected $outputBuffer;
14
15
    public function __construct()
16
    {
17
        $this->outputBuffer = '';
18
    }
19
20
    /**
21
     * @param array|string $messages
22
     * @param int          $type
23
     */
24
    public function writeln($messages, $type = self::OUTPUT_NORMAL)
25
    {
26
        $this->outputBuffer .= $messages . "\n";
27
    }
28
29
    /**
30
     * @param array|string $messages
31
     * @param bool         $newline
32
     * @param int          $type
33
     */
34
    public function write($messages, $newline = false, $type = 0)
35
    {
36
        $this->outputBuffer .= $messages;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getOutput()
43
    {
44
        return $this->outputBuffer;
45
    }
46
}
47