Passed
Branch master (f36b3c)
by Matthew
08:01
created

Sqlite::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
namespace Fyuze\Database\Drivers;
3
4
use PDO;
5
6
class Sqlite extends Driver
7
{
8
    /**
9
     * @param array $config
10
     */
11 7
    public function __construct(array $config = [])
12
    {
13 7
        $this->config = $config;
14
    }
15
16
    /**
17
     * @codeCoverageIgnore
18
     */
19
    public function open()
20
    {
21
        return new PDO(
22
            sprintf('sqlite:%s', $this->config['database']),
23
            null,
24
            null,
25
            $this->getOptions()
26
        );
27
    }
28
}
29