These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | use Illuminate\Support\Collection; |
||
4 | |||
5 | /* |
||
6 | * Transform a collection into an associative array form collection item. |
||
7 | * |
||
8 | * @return \Illuminate\Support\Collection |
||
9 | */ |
||
10 | Collection::macro('fromPairs', function (): Collection { |
||
11 | return $this->reduce(function ($assoc, array $keyValuePair): Collection { |
||
0 ignored issues
–
show
|
|||
12 | list($key, $value) = $keyValuePair; |
||
13 | $assoc[$key] = $value; |
||
14 | |||
15 | return $assoc; |
||
16 | }, new static); |
||
17 | }); |
||
18 |
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.