Total Complexity | 7 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
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() |
|
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() |
|
67 | } |
||
68 | } |
||
69 |