Completed
Push β€” master ( d34ae1...d2cd4a )
by kill
10:24
created

Mysql::getDb()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by IntelliJ IDEA.
4
 * User: rozbo
5
 * Date: 2017/2/27
6
 * Time: δΈ‹εˆ2:45
7
 */
8
9
namespace puck;
10
11
12
class Mysql extends \MysqliDb{
13
14
    static public function getDb($db){
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
15
        static $dbList;
16
        if(!isset($dbList[$db])){
17
            $dbList[$db]=new \MysqliDb(config('db.'.$db));
18
        }
19
        return $dbList[$db];
20
    }
21
22
23
}