DoctrineReaderFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getReader() 0 4 1
1
<?php
2
3
namespace Ddeboer\DataImport\Reader\Factory;
4
5
use Ddeboer\DataImport\Reader\DoctrineReader;
6
use Doctrine\Common\Persistence\ObjectManager;
7
8
/**
9
 * Factory that creates DoctrineReaders
10
 *
11
 * @author David de Boer <[email protected]>
12
 */
13
class DoctrineReaderFactory
14
{
15
    /**
16
     * @var ObjectManager
17
     */
18
    protected $objectManager;
19
20
    /**
21
     * @param ObjectManager $objectManager
22
     */
23 2
    public function __construct(ObjectManager $objectManager)
24
    {
25 2
        $this->objectManager = $objectManager;
26 2
    }
27
28
    /**
29
     * @param string $object
30
     *
31
     * @return DoctrineReader
32
     */
33 2
    public function getReader($object)
34
    {
35 2
        return new DoctrineReader($this->objectManager, $object);
36
    }
37
}
38