Buffer   A
last analyzed

Coupling/Cohesion

Components 1
Dependencies 0

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 40
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 4 1
A get() 0 4 1
A clean() 0 4 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