Client   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 58
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A failed() 0 3 1
A update() 0 6 1
A delete() 0 3 1
A list() 0 3 1
A register() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the mingyoung/dingtalk.
5
 *
6
 * (c) 张铭阳 <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EasyDingTalk\Callback;
13
14
use EasyDingTalk\Kernel\BaseClient;
15
16
class Client extends BaseClient
17
{
18
    /**
19
     * 注册业务事件回调接口
20
     *
21
     * @param array $params
22
     *
23
     * @return mixed
24
     */
25
    public function register($params)
26
    {
27
        $params['token'] = $this->app['config']->get('token');
28
        $params['aes_key'] = $this->app['config']->get('aes_key');
29
30
        return $this->client->postJson('call_back/register_call_back', $params);
31
    }
32
33
    /**
34
     * 查询事件回调接口
35
     *
36
     * @return mixed
37
     */
38
    public function list()
39
    {
40
        return $this->client->get('call_back/get_call_back');
41
    }
42
43
    /**
44
     * 更新事件回调接口
45
     *
46
     * @return mixed
47
     */
48
    public function update($params)
49
    {
50
        $params['token'] = $this->app['config']->get('token');
51
        $params['aes_key'] = $this->app['config']->get('aes_key');
52
53
        return $this->client->postJson('call_back/update_call_back', $params);
54
    }
55
56
    /**
57
     * 删除事件回调接口
58
     *
59
     * @return mixed
60
     */
61
    public function delete()
62
    {
63
        return $this->client->get('call_back/delete_call_back');
64
    }
65
66
    /**
67
     * 获取回调失败结果
68
     *
69
     * @return mixed
70
     */
71
    public function failed()
72
    {
73
        return $this->client->get('call_back/get_call_back_failed_result');
74
    }
75
}
76