Completed
Push — master ( 0e47aa...7f1501 )
by Dominik
02:53
created

getFieldDenormalizer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Deserialization\Mapping;
6
7
use Chubbyphp\Deserialization\Denormalizer\FieldDenormalizerInterface;
8
9
final class DenormalizationFieldMapping implements DenormalizationFieldMappingInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    private $name;
15
16
    /**
17
     * @var array
18
     */
19
    private $groups;
20
21
    /**
22
     * @var FieldDenormalizerInterface
23
     */
24
    private $fieldDenormalizer;
25
26
    /**
27
     * @param string                     $name
28
     * @param array                      $groups
29
     * @param FieldDenormalizerInterface $fieldDenormalizer
30
     */
31 3
    public function __construct($name, array $groups = [], FieldDenormalizerInterface $fieldDenormalizer)
32
    {
33 3
        $this->name = $name;
34 3
        $this->groups = $groups;
35 3
        $this->fieldDenormalizer = $fieldDenormalizer;
36 3
    }
37
38
    /**
39
     * @return string
40
     */
41 1
    public function getName(): string
42
    {
43 1
        return $this->name;
44
    }
45
46
    /**
47
     * @return array
48
     */
49 1
    public function getGroups(): array
50
    {
51 1
        return $this->groups;
52
    }
53
54
    /**
55
     * @return FieldDenormalizerInterface
56
     */
57 1
    public function getFieldDenormalizer(): FieldDenormalizerInterface
58
    {
59 1
        return $this->fieldDenormalizer;
60
    }
61
}
62