FaceId::getMethod()   A
last analyzed

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 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