Soter::verify()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 3
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace YEntWeChat\Soter;
4
5
use YEntWeChat\Core\AbstractAPI;
6
7
/**
8
 * Class Soter.
9
 */
10
class Soter extends AbstractAPI
11
{
12
    const API_VERIFY_SIGNATURE = 'https://qyapi.weixin.qq.com/cgi-bin/soter/verify_signature';
13
14
    /**
15
     * Verify signature.
16
     *
17
     * @param string $openid
18
     * @param string $jsonString
19
     * @param string $jsonSignature
20
     *
21
     * @return \EntWeChat\Support\Collection
22
     */
23
    public function verify($openid, $jsonString, $jsonSignature)
24
    {
25
        $params = [
26
            'openid'         => $openid,
27
            'json_string'    => $jsonString,
28
            'json_signature' => $jsonSignature,
29
        ];
30
31
        return $this->parseJSON('json', [self::API_VERIFY_SIGNATURE, $params]);
32
    }
33
}
34