Passed
Push — master ( 03ea78...8fc551 )
by Harry
10:08
created

PdoFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPdo() 0 7 1
1
<?php
2
3
namespace Graze\Sprout\Db;
4
5
use Graze\Sprout\Config\ConnectionConfigInterface;
6
use PDO;
7
8
class PdoFactory
9
{
10
    /**
11
     * @param ConnectionConfigInterface $connection
12
     * @param array                     $options
13
     *
14
     * @return PDO
15
     */
16
    public function getPdo(ConnectionConfigInterface $connection, array $options = [])
17
    {
18
        return new PDO(
19
            $connection->getDsn(),
20
            $connection->getUser(),
21
            $connection->getPassword(),
22
            $options
23
        );
24
    }
25
}
26