Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public static function redisListToArray(array $list) |
||
24 | { |
||
25 | // Redis lists come into a format where the keys are on even indexes |
||
26 | // and the values are on odd indexes. This way, we know which |
||
27 | // ones are keys and which ones are values and their get combined |
||
28 | // later to form the key => value array. |
||
29 | [$keys, $values] = collect($list)->partition(function ($value, $key) { |
||
30 | return $key % 2 === 0; |
||
31 | }); |
||
32 | |||
33 | return array_combine($keys->all(), $values->all()); |
||
34 | } |
||
35 | |||
51 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.