Test Setup Failed
Push — master ( b50703...9d91c5 )
by Dominik
06:16
created

DenormalizerContext::isAllowedAdditionalFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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