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

DenormalizerContext   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 38
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isAllowedAdditionalFields() 0 4 1
A getGroups() 0 4 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 $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