Completed
Push — master ( 1b6594...be51ba )
by Agel_Nash
04:51
created

LegacyDatabase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 39
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 25 1
1
<?php namespace AgelxNash\Modx\Evo\Database;
2
3
/**
4
 * @deprecated
5
 */
6
class LegacyDatabase extends AbstractDatabase
7
{
8
    /**
9
     * @param string $host
10
     * @param string $database
11
     * @param string $username
12
     * @param string $password
13
     * @param string $prefix
14
     * @param string $charset
15
     * @param string $method
16
     * @param string $collation
17
     * @param string $driver
18
     * @throws Exceptions\Exception
19
     */
20 3
    public function __construct(
21
        $host = '',
22
        $database = '',
23
        $username = '',
24
        $password = '',
25
        $prefix = '',
26
        $charset = 'utf8mb4',
27
        $method = 'SET CHARACTER SET',
28
        $collation = 'utf8mb4_unicode_ci',
29
        $driver = Drivers\MySqliDriver::class
30
    ) {
31 3
        $database = trim($database, '`');
32
33 3
        $this->setConfig(compact(
34 3
            'host',
35 3
            'database',
36 3
            'username',
37 3
            'password',
38 3
            'prefix',
39 3
            'charset',
40 3
            'method',
41 3
            'collation'
42
        ));
43
44 3
        $this->setDriver($driver);
45 3
    }
46
}
47