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.

Context   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 0

Test Coverage

Coverage 78.95%

Importance

Changes 0
Metric Value
dl 0
loc 49
ccs 15
cts 19
cp 0.7895
rs 10
c 0
b 0
f 0
wmc 7
lcom 3
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A appendSql() 0 11 3
A appendParams() 0 3 1
A handleResult() 0 8 2
1
<?php
2
namespace PhpBoot\DB;
3
/**
4
 * @author caoym
5
 */
6
class Context{
7
8 56
    public function __construct($connection)
9
    {
10 56
        $this->connection = $connection;
11 56
    }
12
13
    /**
14
     * 拼接sql语句,并自动插入空格
15
     * @param string $sql 表达式
16
     */
17 56
    public function appendSql($sql, $addSpace=true){
18 56
        if($this->sql == ''){
19 56
            $this->sql = $sql;
20 56
        }else{
21 54
            if($addSpace){
22 51
                $this->sql = $this->sql.' '.$sql;
23 51
            }else{
24 6
                $this->sql = $this->sql.$sql;
25
            }
26
        }
27 56
    }
28
    /**
29
     * 增加绑定变量值
30
     * @param array $params 变量
31
     */
32 37
    public function appendParams($params){
33 37
        $this->params = array_merge($this->params, $params);
34 37
    }
35
36
    public function handleResult($result)
37
    {
38
        if($resultHandler = $this->resultHandler){
39
            return $resultHandler($result);
40
        }else{
41
            return $result;
42
        }
43
    }
44
    /**
45
     * @var callable
46
     */
47
    public $resultHandler;
48
    public $sql='';
49
    public $params=[];
50
    /**
51
     * @var \PDO
52
     */
53
    public $connection;
54
}