FakeNormalizerContext   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 54
c 0
b 0
f 0
wmc 8
lcom 3
cbo 0
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A withRoot() 0 6 1
A getRoot() 0 4 1
A withFormat() 0 6 1
A getFormat() 0 4 1
A withParent() 0 7 1
A getParent() 0 4 1
A getLevel() 0 4 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