Buffer::write()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace League\CLImate\Util\Writer;
4
5
class Buffer implements WriterInterface
6
{
7
    /**
8
     * @var string $contents The buffered data.
9
     */
10
    protected $contents = "";
11
12
    /**
13
     * Write the content to the buffer.
14
     *
15
     * @param string $content
16
     *
17
     * @return void
18
     */
19 16
    public function write($content)
20
    {
21 16
        $this->contents .= $content;
22 16
    }
23
24
25
    /**
26
     * Get the buffered data.
27
     *
28
     * @return string
29
     */
30 16
    public function get()
31
    {
32 16
        return $this->contents;
33
    }
34
35
    /**
36
     * Clean the buffer and throw away any data.
37
     *
38
     * @return void
39
     */
40 4
    public function clean()
41
    {
42 4
        $this->contents = "";
43 4
    }
44
}
45