GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 804d88...9de2aa )
by t
02:26
created

Connection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 3
1
<?php
2
/**
3
 * Class Connection
4
 *
5
 * @link https://www.icy2003.com/
6
 * @author icy2003 <[email protected]>
7
 * @copyright Copyright (c) 2017, icy2003
8
 */
9
10
namespace icy2003\php\iexts\yii2\db;
11
12
use icy2003\php\iexts\yii2\db\mysql\Schema;
13
use icy2003\php\iexts\yii2\db\PDO;
14
use yii\db\Connection as C;
15
16
/**
17
 * Connection 扩展
18
 *
19
 * 示例 db 配置:
20
 * [
21
 *     'class' => Connection::className(),
22
 *     'dsn' => 'imysql:host=127.0.0.1;dbname=test',
23
 * ]
24
 */
25
class Connection extends C
26
{
27
28
    /**
29
     * 初始化
30
     *
31
     * @return void
32
     */
33
    public function init()
34
    {
35
        $this->schemaMap['imysql'] = Schema::className();
36
        $this->commandMap['imysql'] = Command::className();
37
    }
38
39
    /**
40
     * 创建 PDO 对象
41
     *
42
     * @return \PDO
43
     */
44
    public function createPdoInstance()
45
    {
46
        $driver = $this->getDriverName();
47
        if (in_array($driver, ['imysql'])) {
48
            $pdoClass = PDO::className();
49
            return new $pdoClass($this->dsn, $this->username, $this->password, $this->attributes);
50
        } else {
51
            return parent::createPdoInstance();
52
        }
53
    }
54
}
55