DbalReaderFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

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\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