Completed
Pull Request — master (#12)
by Dominik
07:37 queued 14s
created

NormalizationFieldMapping::getPermission()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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
     * @var object|string|null
28
     */
29
    private $permission;
30
31
    /**
32
     * @param string                   $name
33
     * @param array                    $groups
34
     * @param FieldNormalizerInterface $fieldNormalizer
35
     * @param object|string|null       $permission
36
     */
37 3
    public function __construct($name, array $groups, FieldNormalizerInterface $fieldNormalizer, $permission = null)
38
    {
39 3
        $this->name = $name;
40 3
        $this->groups = $groups;
41 3
        $this->fieldNormalizer = $fieldNormalizer;
42 3
        $this->permission = $permission;
43 3
    }
44
45
    /**
46
     * @return string
47
     */
48 1
    public function getName(): string
49
    {
50 1
        return $this->name;
51
    }
52
53
    /**
54
     * @return string[]
55
     */
56 1
    public function getGroups(): array
57
    {
58 1
        return $this->groups;
59
    }
60
61
    /**
62
     * @return FieldNormalizerInterface
63
     */
64 1
    public function getFieldNormalizer(): FieldNormalizerInterface
65
    {
66 1
        return $this->fieldNormalizer;
67
    }
68
69
    /**
70
     * @return object|string|null
71
     */
72
    public function getPermission()
73
    {
74
        return $this->permission;
75
    }
76
}
77