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

NormalizationFieldMapping   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 53
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getGroups() 0 4 1
A getFieldNormalizer() 0 4 1
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