-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversions.php
More file actions
34 lines (27 loc) · 959 Bytes
/
Copy pathversions.php
File metadata and controls
34 lines (27 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
declare(strict_types=1);
use Composer\InstalledVersions;
use React\EventLoop\Loop;
use ReactParallel\EventLoop\EventLoopBridge;
use ReactParallel\Pool\Infinite\Infinite;
use function React\Async\async;
require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
$infinite = new Infinite(new EventLoopBridge(), 0.1);
Loop::futureTick(async(static function () use ($infinite): void {
Loop::addTimer(1, static function () use ($infinite): void {
$infinite->kill();
Loop::stop();
});
var_export(
$infinite->run(
static fn (): array => array_merge(
...array_map(
static fn (string $package): array => [
$package => InstalledVersions::getPrettyVersion($package),
],
InstalledVersions::getInstalledPackages(),
),
),
),
);
}));