Passed
Push — master ( 447157...f66c71 )
by Dominik
01:59
created

DenormalizerContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 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 string[]
16
     */
17
    private $groups = [];
18
19
    /**
20
     * @param bool     $allowedAdditionalFields
21
     * @param string[] $groups
22
     */
23 2
    public function __construct($allowedAdditionalFields = false, array $groups = [])
24
    {
25 2
        $this->allowedAdditionalFields = $allowedAdditionalFields;
26 2
        $this->groups = $groups;
27 2
    }
28
29
    /**
30
     * @return bool
31
     */
32 2
    public function isAllowedAdditionalFields(): bool
33
    {
34 2
        return $this->allowedAdditionalFields;
35
    }
36
37
    /**
38
     * @return string[]
39
     */
40 2
    public function getGroups(): array
41
    {
42 2
        return $this->groups;
43
    }
44
}
45