SqliteAdapter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A map() 0 17 2
1
<?php namespace Nord\Lumen\Doctrine\ORM\Configuration;
2
3
use Nord\Lumen\Doctrine\ORM\Contracts\ConfigurationAdapter as ConfigurationAdapterContract;
4
5
class SqliteAdapter implements ConfigurationAdapterContract
6
{
7
8
    /**
9
     * @inheritdoc
10
     */
11
    public function map(array $config)
12
    {
13
        $array = [
14
            'driver' => 'pdo_sqlite',
15
            'user' => array_get($config, 'username'),
16
            'password' => array_get($config, 'password'),
17
            'prefix' => array_get($config, 'prefix'),
18
        ];
19
20
        if ($config['database'] === ':memory:') {
21
            $array['memory'] = true;
22
        } else {
23
            $array['path'] = $config['database'];
24
        }
25
26
        return $array;
27
    }
28
}
29