|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Yiisoft\Test\Support\SimpleCache; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* @template TAction as string |
|
9
|
|
|
* @template TKey as mixed |
|
10
|
|
|
* @template TValue as mixed |
|
11
|
|
|
* @template TTtl as mixed |
|
12
|
|
|
*/ |
|
13
|
|
|
final class Action |
|
14
|
|
|
{ |
|
15
|
|
|
public const GET = 'get'; |
|
16
|
|
|
public const SET = 'set'; |
|
17
|
|
|
public const DELETE = 'delete'; |
|
18
|
|
|
public const CLEAR = 'clear'; |
|
19
|
|
|
public const HAS = 'has'; |
|
20
|
|
|
|
|
21
|
|
|
/** @var TAction */ |
|
|
|
|
|
|
22
|
|
|
private string $action; |
|
23
|
|
|
/** @var TKey */ |
|
|
|
|
|
|
24
|
|
|
private $key; |
|
25
|
|
|
/** @var TValue */ |
|
|
|
|
|
|
26
|
|
|
private $value; |
|
27
|
|
|
/** @var TTtl */ |
|
|
|
|
|
|
28
|
|
|
private $ttl; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @param TAction $action |
|
32
|
|
|
* @param TKey $key |
|
33
|
|
|
* @param TValue $value |
|
34
|
|
|
* @param TTtl $ttl |
|
35
|
|
|
*/ |
|
36
|
158 |
|
private function __construct(string $action, $key = null, $value = null, $ttl = null) |
|
37
|
|
|
{ |
|
38
|
158 |
|
$this->action = $action; |
|
|
|
|
|
|
39
|
158 |
|
$this->key = $key; |
|
40
|
158 |
|
$this->value = $value; |
|
41
|
158 |
|
$this->ttl = $ttl; |
|
42
|
158 |
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* @return TAction |
|
46
|
|
|
*/ |
|
47
|
19 |
|
public function getAction(): string |
|
48
|
|
|
{ |
|
49
|
19 |
|
return $this->action; |
|
|
|
|
|
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @return TKey |
|
54
|
|
|
*/ |
|
55
|
20 |
|
public function getKey() |
|
56
|
|
|
{ |
|
57
|
20 |
|
return $this->key; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @return TValue |
|
62
|
|
|
*/ |
|
63
|
5 |
|
public function getValue() |
|
64
|
|
|
{ |
|
65
|
5 |
|
return $this->value; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @return TTtl |
|
70
|
|
|
*/ |
|
71
|
5 |
|
public function getTtl() |
|
72
|
|
|
{ |
|
73
|
5 |
|
return $this->ttl; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @param mixed $key |
|
78
|
|
|
*/ |
|
79
|
91 |
|
public static function createGetAction($key): self |
|
80
|
|
|
{ |
|
81
|
91 |
|
return new self(self::GET, $key); |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @param mixed $key |
|
86
|
|
|
*/ |
|
87
|
39 |
|
public static function createHasAction($key): self |
|
88
|
|
|
{ |
|
89
|
39 |
|
return new self(self::HAS, $key); |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @param mixed $key |
|
94
|
|
|
* @param mixed $value |
|
95
|
|
|
* @param mixed $ttl |
|
96
|
|
|
*/ |
|
97
|
112 |
|
public static function createSetAction($key, $value, $ttl): self |
|
98
|
|
|
{ |
|
99
|
112 |
|
return new self(self::SET, $key, $value, $ttl); |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* @param mixed $key |
|
104
|
|
|
*/ |
|
105
|
34 |
|
public static function createDeleteAction($key): self |
|
106
|
|
|
{ |
|
107
|
34 |
|
return new self(self::DELETE, $key); |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
85 |
|
public static function createClearAction(): self |
|
111
|
|
|
{ |
|
112
|
85 |
|
return new self(self::CLEAR); |
|
113
|
|
|
} |
|
114
|
|
|
} |
|
115
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths