Connection::open()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Lagdo\DbAdmin\Driver\Sqlite\Db\Pdo;
4
5
use Lagdo\DbAdmin\Driver\Db\Pdo\Connection as PdoConnection;
6
use Lagdo\DbAdmin\Driver\Sqlite\Db\ConfigTrait;
7
8
class Connection extends PdoConnection
9
{
10
    use ConfigTrait;
11
12
    /**
13
     * @inheritDoc
14
     */
15
    public function open(string $database, string $schema = '')
16
    {
17
        $options = $this->driver->options();
18
        $filename = $this->filename($database, $options);
19
        $this->dsn("sqlite:$filename", '', '');
20
        $this->query('PRAGMA foreign_keys = 1');
21
        return true;
22
    }
23
}
24