StringWriter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 24
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 4 1
A getString() 0 4 1
A __toString() 0 4 1
1
<?php
2
namespace Networkteam\JsonSeq;
3
4
class StringWriter implements WriterInterface
5
{
6
7
    /**
8
     * @var string
9
     */
10
    private $buffer = '';
11
12 1
    public function write(string $content): void
13
    {
14 1
        $this->buffer .= $content;
15 1
    }
16
17 2
    public function getString(): string
18
    {
19 2
        return $this->buffer;
20
    }
21
22
    public function __toString()
23
    {
24
        return $this->getString();
25
    }
26
27
}