Gateway::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
namespace tinymeng\code\Connector;
3
4
/**
5
 * Class Name: Gateway
6
 * @author Tinymeng <[email protected]>
7
 * @date: 2019/9/27 11:46
8
 * @package tinymeng\code\Connector
9
 */
10
abstract class Gateway implements GatewayInterface
11
{
12
    /**
13
     * 配置参数
14
     * @var array
15
     */
16
    protected $config;
17
18
    /**
19
     * 是否开启debug
20
     * @var bool
21
     */
22
    protected $debug = false;
23
24
    /**
25
     * Gateway constructor.
26
     * @param null $config
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $config is correct as it would always require null to be passed?
Loading history...
27
     * @throws \Exception
28
     */
29
    public function __construct($config = [])
30
    {
31
        //默认参数
32
        $_config = [
0 ignored issues
show
Unused Code introduced by
The assignment to $_config is dead and can be removed.
Loading history...
33
            'debug'=>false
34
        ];
35
        $this->config = $config;
36
//        $this->config = array_replace_recursive($_config,$config);
37
    }
38
39
    /**
40
     * Function Name: 开启debug
41
     * @param boolean $debug
42
     * @author Tinymeng <[email protected]>
43
     * @date: 2019/9/26 10:44
44
     */
45
    public function setDebug($debug){
46
        $this->debug = $debug;
47
    }
48
49
}
50