Total Complexity | 7 |
Total Lines | 81 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | abstract class Request |
||
8 | { |
||
9 | protected $config = []; |
||
10 | protected $cache; |
||
11 | protected $param = []; |
||
12 | |||
13 | public function __construct(array $config, ?Cache $cache = null) |
||
17 | } |
||
18 | |||
19 | /** |
||
20 | * 获取应用ID |
||
21 | * |
||
22 | * @return string |
||
23 | * @author herry.yao <[email protected]> |
||
24 | * @version 1.2.2 |
||
25 | * @date 2020-08-05 |
||
26 | */ |
||
27 | public function getAppId(): string |
||
28 | { |
||
29 | return $this->config['app_id']; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * 获取授权秘钥 |
||
34 | * |
||
35 | * @return string |
||
36 | * @author herry.yao <[email protected]> |
||
37 | * @version 1.2.2 |
||
38 | * @date 2020-08-05 |
||
39 | */ |
||
40 | protected function getAppKey(): string |
||
41 | { |
||
42 | return $this->config['app_key']; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * 返回数组 |
||
47 | * |
||
48 | * @return array |
||
49 | * @author herry.yao <[email protected]> |
||
50 | * @version 1.2.2 |
||
51 | * @date 2020-08-05 |
||
52 | */ |
||
53 | public function toArray(): array |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * call |
||
60 | * |
||
61 | * @param $name |
||
62 | * @param $arguments |
||
63 | * @return Request |
||
64 | * @version 1.2.2 |
||
65 | * @date 2020-08-05 |
||
66 | * @author herry.yao <[email protected]> |
||
67 | */ |
||
68 | public function __call($name, $arguments) |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * 魔术方法赋值 |
||
80 | * |
||
81 | * @param $name |
||
82 | * @param $value |
||
83 | */ |
||
84 | public function __set($name, $value) |
||
88 | } |
||
89 | } |