Completed
Branch master (63f127)
by Dominik
03:47 queued 01:52
created

DenormalizerContext::isReplaceMode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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 string[]
16
     */
17
    private $groups = [];
18
19
    /**
20
     * @param bool $allowedAdditionalFields
21
     *
22
     * @return self
23
     */
24
    public function setAllowedAdditionalFields(bool $allowedAdditionalFields): self
25
    {
26
        $this->allowedAdditionalFields = $allowedAdditionalFields;
27
28
        return $this;
29
    }
30
31
    /**
32
     * @return bool
33
     */
34
    public function isAllowedAdditionalFields(): bool
35
    {
36
        return $this->allowedAdditionalFields;
37
    }
38
39
    /**
40
     * @param string[] $groups
41
     *
42
     * @return self
43
     */
44
    public function setGroups(array $groups): self
45
    {
46
        $this->groups = $groups;
47
48
        return $this;
49
    }
50
51
    /**
52
     * @return string[]
53
     */
54
    public function getGroups(): array
55
    {
56
        return $this->groups;
57
    }
58
}
59