SqliteDriver::dsn()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace SimplePDO\Drivers;
3
4
use SimplePDO\Configuration;
5
use SimplePDO\Drivers\DriverInterface;
6
7
class SqliteDriver implements DriverInterface
8
{
9
10
    /**
11
     * {@inheritdoc}
12
     */
13
    final public static function dsn(Configuration $configuration)
14
    {
15
        $driver = $configuration->get('GENERAL', 'DRIVER');
16
        $dbname = $configuration->get('SQLITE', 'DBNAME');
17
        return ($driver == 'SQLITE') ? "sqlite:{$dbname}" : "sqlite2:{$dbname}";
18
    }
19
}
20