Completed
Push — master ( 4413ea...c99ea4 )
by Aurimas
02:59
created

BaseDataMapper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 33
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setDataMappers() 0 6 1
A getMapper() 0 4 1
A supports() 0 4 1
1
<?php
2
3
namespace Thruster\Component\DataMapper;
4
5
/**
6
 * Class BaseDataMapper
7
 *
8
 * @package Thruster\Component\DataMapper
9
 * @author  Aurimas Niekis <[email protected]>
10
 */
11
abstract class BaseDataMapper implements DataMapperInterface
12
{
13
    /**
14
     * @var DataMappers
15
     */
16
    protected $dataMappers;
17
    
18
    /**
19
     * @inheritDoc
20
     */
21 1
    public function setDataMappers(DataMappers $dataMappers)
22
    {
23 1
        $this->dataMappers = $dataMappers;
24
25 1
        return $this;
26
    }
27
28
    /**
29
     * @inheritDoc
30
     */
31 1
    public function getMapper(string $name) : DataMapper
32
    {
33 1
        return $this->dataMappers->getMapper($name);
34
    }
35
36
    /**
37
     * @inheritDoc
38
     */
39 1
    public function supports($input) : bool
40
    {
41 1
        return true;
42
    }
43
}
44