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.
Passed
Pull Request — master (#231)
by Yong
09:44 queued 05:23
created

EcsRamRoleCredential::getRoleName()   A

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 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace AlibabaCloud\Client\Credentials;
4
5
use AlibabaCloud\Client\Filter\CredentialFilter;
6
use AlibabaCloud\Client\Exception\ClientException;
7
8
/**
9
 * Use the RAM role of an ECS instance to complete the authentication.
10
 *
11
 * @package   AlibabaCloud\Client\Credentials
12
 */
13
class EcsRamRoleCredential implements CredentialsInterface
14
{
15
16
    /**
17
     * @var string
18
     */
19
    private $roleName;
20
21
    /**
22
     * Class constructor.
23
     *
24
     * @param string $roleName
25
     *
26
     * @throws ClientException
27
     */
28 24
    public function __construct($roleName)
29
    {
30 24
        CredentialFilter::roleName($roleName);
31
32 20
        $this->roleName = $roleName;
33 20
    }
34
35
    /**
36
     * @return string
37
     */
38 13
    public function getRoleName()
39
    {
40 13
        return $this->roleName;
41
    }
42
43
    /**
44
     * @return string
45
     */
46 15
    public function __toString()
47
    {
48 15
        return "roleName#$this->roleName";
49
    }
50
}
51