Completed
Push — master ( 005ddd...9800f2 )
by frey
04:38
created

FaceId   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 12
c 1
b 0
f 1
dl 0
loc 53
ccs 0
cts 23
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getMethod() 0 3 1
A getDetectInfo() 0 9 1
A detectAuth() 0 7 1
A handle() 0 3 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 $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' => $ruleId,
40
        ]);
41
42
        return $this->request($params, 'DetectAuth', 'faceid');
43
    }
44
45
    /**
46
     * @param $ruleId
47
     * @param $bizToken
48
     * @param int $infoType
49
     *
50
     * @return array|bool
51
     */
52
    public function getDetectInfo($ruleId, $bizToken, $infoType = 0)
53
    {
54
        $params = [
55
            'RuleId' => $ruleId,
56
            'BizToken' => $bizToken,
57
            'InfoType' => $infoType,
58
        ];
59
60
        return $this->request($params, 'GetDetectInfo', 'faceid');
61
    }
62
}