Passed
Push — master ( 5f6485...00c044 )
by Michael
02:31
created

MappingContext   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 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\DefinitionInterface;
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 DefinitionInterface
26
     */
27
    protected $definition;
28
29
    /**
30
     * MappingContext constructor.
31
     *
32
     * @param ObjectMapper        $mapper
33
     * @param DefinitionInterface $definition
34
     */
35 3
    public function __construct(ObjectMapper $mapper, DefinitionInterface $definition)
36
    {
37 3
        $this->mapper     = $mapper;
38 3
        $this->definition = $definition;
39 3
    }
40
41
    /**
42
     * Get object mapper
43
     *
44
     * @return ObjectMapper
45
     */
46 1
    public function getMapper(): ObjectMapper
47
    {
48 1
        return $this->mapper;
49
    }
50
51
    /**
52
     * Get mapping configuration
53
     *
54
     * @return DefinitionInterface
55
     */
56 1
    public function getDefinition(): DefinitionInterface
57
    {
58 1
        return $this->definition;
59
    }
60
}