Completed
Push — master ( c120c5...a414f1 )
by Dominik
02:47
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 string[]
16
     */
17
    private $groups = [];
18
19
    /**
20
     * @param bool     $allowedAdditionalFields
21
     * @param string[] $groups
22
     */
23
    public function __construct($allowedAdditionalFields, array $groups)
24
    {
25
        $this->allowedAdditionalFields = $allowedAdditionalFields;
26
        $this->groups = $groups;
27
    }
28
29
    /**
30
     * @return bool
31
     */
32
    public function isAllowedAdditionalFields(): bool
33
    {
34
        return $this->allowedAdditionalFields;
35
    }
36
37
    /**
38
     * @return string[]
39
     */
40
    public function getGroups(): array
41
    {
42
        return $this->groups;
43
    }
44
}
45