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

FaceId::getMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
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
}