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.

DefaultAcsClient   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getAcsResponse() 0 7 2
1
<?php
2
3
namespace AlibabaCloud\Client;
4
5
use AlibabaCloud\Client\Result\Result;
6
use AlibabaCloud\Client\Clients\Client;
7
use AlibabaCloud\Client\Request\Request;
8
use AlibabaCloud\Client\Exception\ClientException;
9
use AlibabaCloud\Client\Exception\ServerException;
10
11
/**
12
 * Class DefaultAcsClient
13
 *
14
 * @package    AlibabaCloud
15
 *
16
 * @deprecated deprecated since version 2.0, Use AlibabaCloud instead.
17
 * @codeCoverageIgnore
18
 */
19
class DefaultAcsClient
20
{
21
22
    /**
23
     * @var string
24
     */
25
    public $randClientName;
26
27
    /**
28
     * DefaultAcsClient constructor.
29
     *
30
     * @param Client $client
31
     *
32
     * @throws ClientException
33
     */
34
    public function __construct(Client $client)
35
    {
36
        $this->randClientName = \uniqid('', true);
37
        $client->name($this->randClientName);
38
    }
39
40
    /**
41
     * @param Request|Result $request
42
     *
43
     * @return Result|string
44
     * @throws ClientException
45
     * @throws ServerException
46
     */
47
    public function getAcsResponse($request)
48
    {
49
        if ($request instanceof Result) {
50
            return $request;
51
        }
52
53
        return $request->client($this->randClientName)->request();
54
    }
55
}
56