DbalReaderFactory::getReader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Ddeboer\DataImport\Reader\Factory;
4
5
use Ddeboer\DataImport\Reader\DbalReader;
6
use Doctrine\DBAL\Connection;
7
8
/**
9
 * Factory that creates DbalReaders
10
 *
11
 * @author David de Boer <[email protected]>
12
 */
13
class DbalReaderFactory
14
{
15
    /**
16
     * @var Connection
17
     */
18
    protected $connection;
19
20
    /**
21
     * @param Connection $connection
22
     */
23
    public function __construct(Connection $connection)
24
    {
25
        $this->connection = $connection;
26
    }
27
28
    /**
29
     * @param string $sql
30
     * @param array  $params
31
     *
32
     * @return DbalReader
33
     */
34
    public function getReader($sql, array $params = [])
35
    {
36
        return new DbalReader($this->connection, $sql, $params);
37
    }
38
}
39