Completed
Push — master ( a3231e...8de51f )
by Dominik
02:02
created

DenormalizerContext   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 77
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setAllowedAdditionalFields() 0 6 1
A isAllowedAdditionalFields() 0 4 1
A setReplaceMode() 0 6 1
A isReplaceMode() 0 4 1
A setGroups() 0 6 1
A getGroups() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Deserialization\Denormalizer;
6
7
final class DenormalizerContext implements DenormalizerContextInterface
8
{
9
    /**
10
     * @var bool
11
     */
12
    private $allowedAdditionalFields = false;
13
14
    /**
15
     * @var bool
16
     */
17
    private $replaceMode = false;
18
19
    /**
20
     * @var string[]
21
     */
22
    private $groups = [];
23
24
    /**
25
     * @param bool $allowedAdditionalFields
26
     *
27
     * @return self
28
     */
29
    public function setAllowedAdditionalFields(bool $allowedAdditionalFields): self
30
    {
31
        $this->allowedAdditionalFields = $allowedAdditionalFields;
32
33
        return $this;
34
    }
35
36
    /**
37
     * @return bool
38
     */
39
    public function isAllowedAdditionalFields(): bool
40
    {
41
        return $this->allowedAdditionalFields;
42
    }
43
44
    /**
45
     * @param bool $replaceMode
46
     *
47
     * @return self
48
     */
49
    public function setReplaceMode(bool $replaceMode): self
50
    {
51
        $this->replaceMode = $replaceMode;
52
53
        return $this;
54
    }
55
56
    /**
57
     * @return bool
58
     */
59
    public function isReplaceMode(): bool
60
    {
61
        return $this->replaceMode;
62
    }
63
64
    /**
65
     * @param string[] $groups
66
     *
67
     * @return self
68
     */
69
    public function setGroups(array $groups): self
70
    {
71
        $this->groups = $groups;
72
73
        return $this;
74
    }
75
76
    /**
77
     * @return string[]
78
     */
79
    public function getGroups(): array
80
    {
81
        return $this->groups;
82
    }
83
}
84