Test Failed
Push — master ( 8a2b60...8e4848 )
by Dominik
03:00
created

NormalizationFieldMapping::getName()   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\Serialization\Mapping;
6
7
use Chubbyphp\Serialization\Normalizer\FieldNormalizerInterface;
8
9
final class NormalizationFieldMapping implements NormalizationFieldMappingInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    private $name;
15
16
    /**
17
     * @var array
18
     */
19
    private $groups;
20
21
    /**
22
     * @var FieldNormalizerInterface
23
     */
24
    private $fieldNormalizer;
25
26
    /**
27
     * @param string                   $name
28
     * @param array                    $groups
29
     * @param FieldNormalizerInterface $fieldNormalizer
30
     */
31
    public function __construct($name, array $groups = [], FieldNormalizerInterface $fieldNormalizer)
32
    {
33
        $this->name = $name;
34
        $this->groups = $groups;
35
        $this->fieldNormalizer = $fieldNormalizer;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getName(): string
42
    {
43
        return $this->name;
44
    }
45
46
    /**
47
     * @return array
48
     */
49
    public function getGroups(): array
50
    {
51
        return $this->groups;
52
    }
53
54
    /**
55
     * @return FieldNormalizerInterface
56
     */
57
    public function getFieldNormalizer(): FieldNormalizerInterface
58
    {
59
        return $this->fieldNormalizer;
60
    }
61
}
62