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 (#81)
by Yong
04:48
created

HistoryTrait::rememberHistory()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AlibabaCloud\Client\Traits;
4
5
/**
6
 * Trait HistoryTrait
7
 *
8
 * @package AlibabaCloud\Client\Traits
9
 */
10
trait HistoryTrait
11
{
12
    /**
13
     * @var array
14
     */
15
    private static $history = [];
16
17
    /**
18
     * @var bool
19
     */
20
    private static $isRememberHistory = false;
21
22
    /**
23
     * @return array
24
     */
25 3
    public static function getHistory()
26
    {
27 3
        return self::$history;
28
    }
29
30 3
    public static function flushHistory()
31
    {
32 3
        self::$history = [];
33 3
    }
34
35 1
    public static function notRememberHistory()
36
    {
37 1
        self::$isRememberHistory = false;
38 1
    }
39
40 1
    public static function rememberHistory()
41
    {
42 1
        self::$isRememberHistory = true;
43 1
    }
44
45
    /**
46
     * @return bool
47
     */
48 65
    public static function isRememberHistory()
49
    {
50 65
        return self::$isRememberHistory;
51
    }
52
53
    /**
54
     * @return array
55
     */
56 1
    public static function &referenceHistory()
57
    {
58 1
        return self::$history;
59
    }
60
61
    /**
62
     * @return int
63
     */
64 3
    public static function countHistory()
65
    {
66 3
        return count(self::$history);
67
    }
68
}
69