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 (#133)
by Yong
03:21
created

DefaultRegionTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 47
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getGlobalRegionId() 0 3 1
A getDefaultRegionId() 0 3 1
A setGlobalRegionId() 0 3 1
A setDefaultRegionId() 0 5 1
1
<?php
2
3
namespace AlibabaCloud\Client\Traits;
4
5
use RuntimeException;
6
use AlibabaCloud\Client\AlibabaCloud;
7
use AlibabaCloud\Client\Filter\ClientFilter;
8
use AlibabaCloud\Client\Exception\ClientException;
9
10
/**
11
 * Trait DefaultRegionTrait
12
 *
13
 * @package   AlibabaCloud\Client\Traits
14
 *
15
 * @mixin     AlibabaCloud
16
 */
17
trait DefaultRegionTrait
18
{
19
    /**
20
     * @var string|null Default RegionId
21
     */
22
    protected static $defaultRegionId;
23
24
    /**
25
     * @deprecated
26
     * @codeCoverageIgnore
27
     */
28
    public static function setGlobalRegionId()
29
    {
30
        throw new RuntimeException('deprecated since 2.0, Use setDefaultRegionId() instead.');
31
    }
32
33
    /**
34
     * @deprecated
35
     * @codeCoverageIgnore
36
     */
37
    public static function getGlobalRegionId()
38
    {
39
        throw new RuntimeException('deprecated since 2.0, Use getGlobalRegionId() instead.');
40
    }
41
42
    /**
43
     * Get the default RegionId.
44
     *
45
     * @return string|null
46
     */
47 6
    public static function getDefaultRegionId()
48
    {
49 6
        return self::$defaultRegionId;
50
    }
51
52
    /**
53
     * Set the default RegionId.
54
     *
55
     * @param string $regionId
56
     *
57
     * @throws ClientException
58
     */
59 8
    public static function setDefaultRegionId($regionId)
60
    {
61 8
        ClientFilter::regionId($regionId);
62
63 6
        self::$defaultRegionId = $regionId;
64 6
    }
65
}
66