DefaultMappingFactory::factor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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