DefaultMappingFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A factor() 0 4 1
1
<?php
2
3
namespace Mathielen\ImportEngine\Mapping;
4
5
use Ddeboer\DataImport\Reader\ReaderInterface;
6
7
class DefaultMappingFactory implements MappingFactoryInterface
8
{
9
    /**
10
     * @var Mappings
11
     */
12
    private $mappings;
13
14 21
    public function __construct(Mappings $mappings = null)
15
    {
16 21
        if (is_null($mappings)) {
17 21
            $mappings = new Mappings();
18
        }
19
20 21
        $this->mappings = $mappings;
21 21
    }
22
23
    /**
24
     * (non-PHPdoc).
25
     *
26
     * @see \Mathielen\ImportEngine\Mapping\MappingFactoryInterface::factor()
27
     */
28 18
    public function factor(ReaderInterface $reader)
29
    {
30 18
        return $this->mappings;
31
    }
32
}
33