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.

DefaultRegionTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 49
ccs 4
cts 4
cp 1
rs 10
wmc 4

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