MappingContext   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMapper() 0 4 1
A getDefinition() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Mikemirten\Component\JsonApi\Mapper;
5
6
use Mikemirten\Component\JsonApi\Mapper\Definition\Definition;
7
8
/**
9
 * Context of mapping
10
 *
11
 * @package Mikemirten\Component\JsonApi\Mapper
12
 */
13
class MappingContext
14
{
15
    /**
16
     * Object mapper
17
     *
18
     * @var ObjectMapper
19
     */
20
    protected $mapper;
21
22
    /**
23
     * Mapping definition
24
     *
25
     * @var Definition
26
     */
27
    protected $definition;
28
29
    /**
30
     * MappingContext constructor.
31
     *
32
     * @param ObjectMapper $mapper
33
     * @param Definition   $definition
34
     */
35 4
    public function __construct(ObjectMapper $mapper, Definition $definition) {
36 4
        $this->mapper     = $mapper;
37 4
        $this->definition = $definition;
38 4
    }
39
40
    /**
41
     * Get object mapper
42
     *
43
     * @return ObjectMapper
44
     */
45 1
    public function getMapper(): ObjectMapper
46
    {
47 1
        return $this->mapper;
48
    }
49
50
    /**
51
     * Get mapping configuration
52
     *
53
     * @return Definition
54
     */
55 3
    public function getDefinition(): Definition
56
    {
57 3
        return $this->definition;
58
    }
59
}