Passed
Push — master ( 60388e...62f2a9 )
by Carlos
04:16
created

API::clearQuota()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[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
/**
13
 * Fundamental API.
14
 *
15
 * @author    mingyoung <[email protected]>
16
 * @copyright 2017
17
 *
18
 * @see      https://github.com/overtrue
19
 * @see      http://overtrue.me
20
 */
21
22
namespace EasyWeChat\Fundamental;
23
24
use EasyWeChat\Core\AbstractAPI;
25
26
class API extends AbstractAPI
27
{
28
    const API_CLEAR_QUOTA = 'https://api.weixin.qq.com/cgi-bin/clear_quota';
29
    const API_CALLBACK_IP = 'https://api.weixin.qq.com/cgi-bin/getcallbackip';
30
31
    /**
32
     * Clear quota.
33
     *
34
     * @return \EasyWeChat\Support\Collection
35
     */
36 1
    public function clearQuota()
37
    {
38 1
        $appid = $this->getAccessToken()->getAppId();
39
40 1
        return $this->parseJSON('json', [self::API_CLEAR_QUOTA, compact('appid')]);
41
    }
42
43
    /**
44
     * Get wechat callback ip.
45
     *
46
     * @return \EasyWeChat\Support\Collection
47
     */
48 1
    public function getCallbackIp()
49
    {
50 1
        return $this->parseJSON('get', [self::API_CALLBACK_IP]);
51
    }
52
}
53