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

DenormalizerContext::setGroups()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
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