1 | <?php |
||
8 | class FeaturedFlagsImpl implements FeaturedFlags |
||
9 | { |
||
10 | protected $_pdo; |
||
11 | protected $_redis; |
||
12 | protected $_date; |
||
13 | |||
14 | CONST TABLE_NAME = 'featured_flags'; |
||
15 | CONST ISENABLED_PREFIX = 'isEnabled_'; |
||
16 | CONST GETVALUES_PREFIX = 'getEnabledValues_'; |
||
17 | |||
18 | /** |
||
19 | * FeaturedFlags constructor. |
||
20 | * @param PDO $pdo |
||
21 | * @param Redis|null $redis |
||
22 | * @param string|null $date |
||
23 | */ |
||
24 | public function __construct(PDO $pdo, Redis $redis = null, $date = null) |
||
34 | |||
35 | /** |
||
36 | * @param PDO $pdo |
||
37 | * @param Redis $redis |
||
38 | * @return FeaturedFlags |
||
39 | */ |
||
40 | public static function getInstance(PDO $pdo, Redis $redis = null) { |
||
43 | |||
44 | /** |
||
45 | * @param string $flagName |
||
46 | * @param array|null $filterParams |
||
47 | * @return boolean |
||
48 | */ |
||
49 | public function isEnabled($flagName, $filterParams = null) |
||
70 | |||
71 | /** |
||
72 | * @param $flagName |
||
73 | * @param $filterParams |
||
74 | * @return null|array |
||
75 | */ |
||
76 | public function getEnabledValues($flagName, $filterParams = null) |
||
98 | |||
99 | /** |
||
100 | * @param Redis $redis |
||
101 | */ |
||
102 | public function setRedis(Redis $redis) |
||
106 | |||
107 | /** |
||
108 | * @param string $cacheKey |
||
109 | * @return null|array |
||
110 | */ |
||
111 | private function _getCacheKey($cacheKey) |
||
120 | |||
121 | /** |
||
122 | * @param string $cacheKey |
||
123 | * @param string $value |
||
124 | */ |
||
125 | private function _setCacheKey($cacheKey, $value) |
||
131 | |||
132 | /** |
||
133 | * @return string |
||
134 | */ |
||
135 | private function _getDate() { |
||
142 | |||
143 | /** |
||
144 | * @param string $query |
||
145 | * @param array $params |
||
146 | * @return \mysqli_stmt |
||
147 | */ |
||
148 | private function _getStmt($query, $params) |
||
156 | |||
157 | /** |
||
158 | * @param string $flagName |
||
159 | * @return array |
||
160 | */ |
||
161 | private function _getDBFlagsData($flagName) |
||
182 | |||
183 | /** |
||
184 | * @param string $query |
||
185 | * @param array $params |
||
186 | * @return array |
||
187 | */ |
||
188 | private function _executeForSelect($query, $params = array()) |
||
194 | |||
195 | /** |
||
196 | * @param array $flagParams |
||
197 | * @param array $filterParams |
||
198 | * @return boolean |
||
199 | */ |
||
200 | private function _compareParams($flagParams, $filterParams) |
||
210 | |||
211 | /** |
||
212 | * @param string $flagParamsJson |
||
213 | * @param array $filterParams |
||
214 | * @return boolean |
||
215 | */ |
||
216 | private function _checkParams($flagParamsJson, $filterParams = null) |
||
229 | |||
230 | /** |
||
231 | * @param string $flagName |
||
232 | * @param array|null $filterParams |
||
233 | * @return boolean |
||
234 | */ |
||
235 | private function _getKey($flagName, $filterParams = null) |
||
239 | |||
240 | /** |
||
241 | * @param string $endDate |
||
242 | * @return int |
||
243 | */ |
||
244 | private function _getTimeout($endDate) |
||
252 | } |
||
253 |
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: