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
Push — master ( 2d0137...54f172 )
by Yong
12:14 queued 08:03
created

AssumeRole::__construct()   A

Complexity

Conditions 4
Paths 5

Size

Total Lines 19
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 4

Importance

Changes 0
Metric Value
cc 4
eloc 16
c 0
b 0
f 0
nc 5
nop 1
dl 0
loc 19
ccs 18
cts 18
cp 1
crap 4
rs 9.7333
1
<?php
2
3
namespace AlibabaCloud\Client\Credentials\Requests;
4
5
use AlibabaCloud\Client\Request\RpcRequest;
6
use AlibabaCloud\Client\Exception\ClientException;
7
use AlibabaCloud\Client\Credentials\Providers\Provider;
8
use AlibabaCloud\Client\Credentials\RamRoleArnCredential;
9
10
/**
11
 * Retrieving assume role credentials.
12
 *
13
 * @package   AlibabaCloud\Client\Credentials\Requests
14
 */
15
class AssumeRole extends RpcRequest
16
{
17
18
    /**
19
     * AssumeRole constructor.
20
     *
21
     * @param RamRoleArnCredential $arnCredential
22
     *
23
     * @throws ClientException
24
     */
25 7
    public function __construct(RamRoleArnCredential $arnCredential)
26
    {
27 7
        parent::__construct();
28 7
        $this->product('Sts');
29 7
        $this->version('2015-04-01');
30 7
        $this->action('AssumeRole');
31 7
        $this->host('sts.aliyuncs.com');
32 7
        $this->scheme('https');
33 7
        $this->regionId('cn-hangzhou');
34 7
        $this->options['verify']                   = false;
35 7
        $this->options['query']['RoleArn']         = $arnCredential->getRoleArn();
36 7
        $this->options['query']['RoleSessionName'] = $arnCredential->getRoleSessionName();
37 7
        $this->options['query']['DurationSeconds'] = Provider::DURATION_SECONDS;
38 7
        if ($arnCredential->getPolicy()) {
39 2
            if (is_array($arnCredential->getPolicy())) {
0 ignored issues
show
introduced by
The condition is_array($arnCredential->getPolicy()) is always false.
Loading history...
40 1
                $this->options['query']['Policy'] = json_encode($arnCredential->getPolicy());
41 1
            }
42 2
            if (is_string($arnCredential->getPolicy())) {
0 ignored issues
show
introduced by
The condition is_string($arnCredential->getPolicy()) is always true.
Loading history...
43 1
                $this->options['query']['Policy'] = $arnCredential->getPolicy();
44 1
            }
45 2
        }
46 7
    }
47
}
48