1 | <?php |
||
9 | class ThrottlerCache implements ThrottlerCacheInterface |
||
10 | { |
||
11 | const CACHE_ITEM_EXPIRY = 0; |
||
12 | |||
13 | /** |
||
14 | * @var CacheItemPoolInterface |
||
15 | */ |
||
16 | private $cacheItemPool; |
||
17 | |||
18 | /** |
||
19 | * ThrottlerCache constructor. |
||
20 | * |
||
21 | * @param CacheItemPoolInterface $cacheItemPool |
||
22 | */ |
||
23 | public function __construct(CacheItemPoolInterface $cacheItemPool) |
||
27 | |||
28 | /** |
||
29 | * @param string $key |
||
30 | * @param string $count |
||
31 | * @param string $limit |
||
32 | * @param string $ttl |
||
33 | */ |
||
34 | public function set(string $key, string $count, string $limit, string $ttl = null) |
||
44 | |||
45 | /** |
||
46 | * @param string $key |
||
47 | * |
||
48 | * @return int|null |
||
49 | */ |
||
50 | public function count(string $key) |
||
57 | |||
58 | /** |
||
59 | * @param string $key |
||
60 | */ |
||
61 | public function increment(string $key) |
||
68 | |||
69 | /** |
||
70 | * @param string $key |
||
71 | */ |
||
72 | public function remove(string $key) |
||
76 | |||
77 | /** |
||
78 | * @param string $key |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | public function hasItem(string $key): bool |
||
86 | |||
87 | /** |
||
88 | * @param string $key |
||
89 | * |
||
90 | * @return bool |
||
91 | */ |
||
92 | public function isExpired(string $key): bool |
||
98 | |||
99 | /** |
||
100 | * @param string $key |
||
101 | * |
||
102 | * @return array|null |
||
103 | */ |
||
104 | private function getParams(string $key) |
||
111 | |||
112 | /** |
||
113 | * @param string $key |
||
114 | * @param array $params |
||
115 | * |
||
116 | * @return CacheItemInterface |
||
117 | */ |
||
118 | private function setParams(string $key, array $params): CacheItemInterface |
||
129 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: