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

DenormalizationFieldMapping   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 53
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

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