GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ShaHmac1Signature::sign()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace AlibabaCloud\Client\Signature;
4
5
/**
6
 * Class ShaHmac1Signature
7
 *
8
 * @package   AlibabaCloud\Signature
9
 */
10
class ShaHmac1Signature extends Signature implements SignatureInterface
11
{
12
13
    /**
14
     * @return string
15
     */
16 66
    public function getMethod()
17
    {
18 66
        return 'HMAC-SHA1';
19
    }
20
21
    /**
22
     * @return string
23
     */
24 64
    public function getType()
25
    {
26 64
        return '';
27
    }
28
29
    /**
30
     * @return string
31
     */
32 66
    public function getVersion()
33
    {
34 66
        return '1.0';
35
    }
36
37
    /**
38
     * @param string $string
39
     * @param string $accessKeySecret
40
     *
41
     * @return string
42
     */
43 66
    public function sign($string, $accessKeySecret)
44
    {
45 66
        return base64_encode(hash_hmac('sha1', $string, $accessKeySecret, true));
46
    }
47
}
48