Passed
Push — master ( 457070...2e278f )
by Dominik
01:56
created

LinkMapping   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 38
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A getLinkSerializer() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Serialization\Mapping;
6
7
use Chubbyphp\Serialization\Serializer\Link\LinkSerializerInterface;
8
9
final class LinkMapping implements LinkMappingInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    private $name;
15
16
    /**
17
     * @var LinkSerializerInterface
18
     */
19
    private $linkSerializer;
20
21
    /**
22
     * @param string                  $name
23
     * @param LinkSerializerInterface $linkSerializer
24
     */
25
    public function __construct(string $name, LinkSerializerInterface $linkSerializer)
26
    {
27
        $this->name = $name;
28
        $this->linkSerializer = $linkSerializer;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getName(): string
35
    {
36
        return $this->name;
37
    }
38
39
    /**
40
     * @return LinkSerializerInterface
41
     */
42
    public function getLinkSerializer(): LinkSerializerInterface
43
    {
44
        return $this->linkSerializer;
45
    }
46
}
47