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

Sqlite::open()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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