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

LazyNormalizationObjectMapping   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 75
c 0
b 0
f 0
wmc 6
lcom 1
cbo 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getClass() 0 4 1
A getNormalizationType() 0 4 1
A getNormalizationFieldMappings() 0 4 1
A getNormalizationEmbeddedFieldMappings() 0 4 1
A getNormalizationLinkMappings() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Serialization\Mapping;
6
7
use Psr\Container\ContainerInterface;
8
9
final class LazyNormalizationObjectMapping implements NormalizationObjectMappingInterface
10
{
11
    /**
12
     * @var ContainerInterface
13
     */
14
    private $container;
15
16
    /**
17
     * @var string
18
     */
19
    private $serviceId;
20
21
    /**
22
     * @var string
23
     */
24
    private $class;
25
26
    /**
27
     * @param ContainerInterface $container
28
     * @param string             $serviceId
29
     * @param string             $class
30
     */
31
    public function __construct(ContainerInterface $container, $serviceId, string $class)
32
    {
33
        $this->container = $container;
34
        $this->serviceId = $serviceId;
35
        $this->class = $class;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getClass(): string
42
    {
43
        return $this->class;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getNormalizationType(): string
50
    {
51
        return $this->container->get($this->serviceId)->getNormalizationType();
52
    }
53
54
    /**
55
     * @param string $path
56
     *
57
     * @return NormalizationFieldMappingInterface[]
58
     */
59
    public function getNormalizationFieldMappings(string $path): array
60
    {
61
        return $this->container->get($this->serviceId)->getNormalizationFieldMappings($path);
62
    }
63
64
    /**
65
     * @param string $path
66
     *
67
     * @return NormalizationFieldMappingInterface[]
68
     */
69
    public function getNormalizationEmbeddedFieldMappings(string $path): array
70
    {
71
        return $this->container->get($this->serviceId)->getNormalizationEmbeddedFieldMappings($path);
72
    }
73
74
    /**
75
     * @param string $path
76
     *
77
     * @return NormalizationLinkMappingInterface[]
78
     */
79
    public function getNormalizationLinkMappings(string $path): array
80
    {
81
        return $this->container->get($this->serviceId)->getNormalizationLinkMappings($path);
82
    }
83
}
84