Test Failed
Push — master ( 792760...743be5 )
by Julien
04:27
created

Devtools::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 13
rs 10
1
<?php
2
3
/**
4
 * This file is part of the Zemit Framework.
5
 *
6
 * (c) Zemit Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zemit\Bootstrap;
13
14
class Devtools extends Config
15
{
16
    public function __construct(array $data = [], bool $insensitive = true)
17
    {
18
        parent::__construct($data, $insensitive);
19
    
20
        $databaseConfig = $this->pathToArray('database');
21
        $driverName = $databaseConfig['default'] ?? 'mysql';
22
        $driverOptions = $databaseConfig['drivers'][$driverName];
23
    
24
        $driverOptions['adapter'] = basename(str_replace('\\', '/', ($driverOptions['adapter'])));
25
        unset($driverOptions['readonly']);
26
//        unset($driverOptions['options']);
27
        
28
        $this->set('database', $driverOptions);
29
    }
30
}
31