FaceId   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 14
c 2
b 0
f 1
dl 0
loc 56
ccs 0
cts 26
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getMethod() 0 3 1
A handle() 0 3 1
A detectAuth() 0 8 1
A getDetectInfo() 0 10 1
1
<?php
2
3
namespace Freyo\Flysystem\QcloudCOSv5\Plugins;
4
5
use Freyo\Flysystem\QcloudCOSv5\Plugins\Traits\TencentCloudAuthV3;
6
use League\Flysystem\Plugin\AbstractPlugin;
7
8
class FaceId extends AbstractPlugin
9
{
10
    use TencentCloudAuthV3;
11
12
    /**
13
     * Get the method name.
14
     *
15
     * @return string
16
     */
17
    public function getMethod()
18
    {
19
        return 'faceId';
20
    }
21
22
    /**
23
     * @return $this
24
     */
25
    public function handle()
26
    {
27
        return $this;
28
    }
29
30
    /**
31
     * @param string $ruleId
32
     * @param array  $options
33
     *
34
     * @return array|bool
35
     */
36
    public function detectAuth($ruleId, array $options = [])
37
    {
38
        $params = array_merge($options, [
39
            'RuleId' => (string) $ruleId,
40
        ]);
41
42
        return $this->request(
43
            $params, 'DetectAuth', 'faceid', '2018-03-01'
44
        );
45
    }
46
47
    /**
48
     * @param string $ruleId
49
     * @param string $bizToken
50
     * @param string $infoType
51
     *
52
     * @return array|bool
53
     */
54
    public function getDetectInfo($ruleId, $bizToken, $infoType = '0')
55
    {
56
        $params = [
57
            'RuleId'   => (string) $ruleId,
58
            'BizToken' => $bizToken,
59
            'InfoType' => (string) $infoType,
60
        ];
61
62
        return $this->request(
63
            $params, 'GetDetectInfo', 'faceid', '2018-03-01'
64
        );
65
    }
66
}
67