3
3
4
4
use Ackintosh \Ganesha \Configuration ;
5
5
use Ackintosh \Ganesha \Storage \AdapterInterface ;
6
+ use Ackintosh \Ganesha \Storage \Adapter \SlidingTimeWindowInterface ;
7
+ use Ackintosh \Ganesha \Storage \Adapter \TumblingTimeWindowInterface ;
6
8
use Ackintosh \Ganesha \Storage \StorageKeysInterface ;
7
9
use Ackintosh \Ganesha \Traits \BuildGanesha ;
8
10
@@ -32,6 +34,7 @@ class Builder
32
34
33
35
/**
34
36
* @param AdapterInterface $adapter
37
+ * @psalm-param (AdapterInterface&SlidingTimeWindowInterface)|(AdapterInterface&TumblingTimeWindowInterface) $adapter
35
38
* @return $this
36
39
*/
37
40
public function adapter (AdapterInterface $ adapter ): self
@@ -42,6 +45,7 @@ public function adapter(AdapterInterface $adapter): self
42
45
43
46
/**
44
47
* @param int $failureRateThreshold
48
+ * @psalm-param int<1, 100> $failureRateThreshold
45
49
* @return $this
46
50
*/
47
51
public function failureRateThreshold (int $ failureRateThreshold ): self
@@ -52,6 +56,7 @@ public function failureRateThreshold(int $failureRateThreshold): self
52
56
53
57
/**
54
58
* @param int $intervalToHalfOpen
59
+ * @psalm-param int<1, max> $intervalToHalfOpen
55
60
* @return $this
56
61
*/
57
62
public function intervalToHalfOpen (int $ intervalToHalfOpen ): self
@@ -72,6 +77,7 @@ public function storageKeys(StorageKeysInterface $storageKeys): self
72
77
73
78
/**
74
79
* @param int $minimumRequests
80
+ * @psalm-param int<1, max> $minimumRequests
75
81
* @return $this
76
82
*/
77
83
public function minimumRequests (int $ minimumRequests ): self
@@ -82,6 +88,7 @@ public function minimumRequests(int $minimumRequests): self
82
88
83
89
/**
84
90
* @param int $timeWindow
91
+ * @psalm-param int<1, max> $timeWindow
85
92
* @return $this
86
93
*/
87
94
public function timeWindow (int $ timeWindow ): self
0 commit comments