FakeNormalizerContext::withFormat()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace Thunder\Serializard\Tests\Fake\Context;
3
4
use Thunder\Serializard\NormalizerContext\NormalizerContextInterface;
5
6
final class FakeNormalizerContext implements NormalizerContextInterface
7
{
8
    private $root;
9
    private $format;
10
    private $parent;
11
    /** @var int */
12
    private $level = 0;
13
14
    public function __construct()
15
    {
16
    }
17
18
    public function withRoot($root)
19
    {
20
        $this->root = $root;
21
22
        return $this;
23
    }
24
25
    public function getRoot()
26
    {
27
        return $this->root;
28
    }
29
30
    public function withFormat($format)
31
    {
32
        $this->format = $format;
33
34
        return $this;
35
    }
36
37
    public function getFormat()
38
    {
39
        return $this->format;
40
    }
41
42
    public function withParent($parent)
43
    {
44
        $this->parent = $parent;
45
        $this->level++;
46
47
        return $this;
48
    }
49
50
    public function getParent()
51
    {
52
        return $this->parent;
53
    }
54
55
    public function getLevel()
56
    {
57
        return $this->level;
58
    }
59
}
60