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::appendParams()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
}