Completed
Push — master ( 86aeb9...b201b7 )
by Freek
01:46
created

src/macros/parallelMap.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

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 function Amp\Promise\wait;
4
use Illuminate\Support\Collection;
5
use function Amp\ParallelFunctions\parallelMap;
6
7
/*
8
 * Idential to map but each item will be processed in parallel.
9
 *
10
 * This function requires the installation of amphp/parallel-functions
11
 *
12
 * @param callable $callback
13
 *
14
 * @return \Illuminate\Support\Collection
15
 */
16
Collection::macro('parallelMap', function (callable $callback): Collection {
17
    $this->items = wait(parallelMap($this->items, $callback));
0 ignored issues
show
The variable $this does not exist. Did you forget to declare it?

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.

Loading history...
18
19
    return $this;
20
});
21