Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies #13

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
],
"require": {
"php": "^8.1",
"amphp/amp": "^2.6.2",
"amphp/parallel": "^1.4.1",
"amphp/parallel-functions": "^1.1",
"amphp/amp": "^v3.0",
"amphp/parallel": "^2.2",
"illuminate/collections": "^9.30|^10.0",
"spatie/laravel-package-tools": "^1.4.3",
"symfony/finder" : "^6.0|^7.0"
Expand Down
14 changes: 6 additions & 8 deletions src/DiscoverWorkers/ParallelDiscoverWorker.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

Check failure on line 1 in src/DiscoverWorkers/ParallelDiscoverWorker.php

View workflow job for this annotation

GitHub Actions / phpstan

Ignored error pattern #^Unable to resolve the template type T in call to function Amp\\Promise\\wait$# in path /home/runner/work/php-structure-discoverer/php-structure-discoverer/src/DiscoverWorkers/ParallelDiscoverWorker.php was not matched in reported errors.

namespace Spatie\StructureDiscoverer\DiscoverWorkers;

use function Amp\ParallelFunctions\parallelMap;
use function Amp\Promise\wait;
use function Amp\async;
use function Amp\Future\await;

use Illuminate\Support\Collection;
use Spatie\StructureDiscoverer\Data\DiscoverProfileConfig;
use function Amp\ParallelFunctions\parallelMap;

Check failure on line 10 in src/DiscoverWorkers/ParallelDiscoverWorker.php

View workflow job for this annotation

GitHub Actions / phpstan

Used function Amp\ParallelFunctions\parallelMap not found.

class ParallelDiscoverWorker implements DiscoverWorker
{
Expand All @@ -19,12 +20,9 @@
{
$sets = $filenames->chunk($this->filesPerJob)->toArray();

$promise = parallelMap(
$sets,
fn (array $set): array => $config->structureParser->execute($set)
);

$found = wait($promise);
$found = await(array_map(function ($set) use ($config) {
return async(fn () => $config->structureParser->execute($set));
}, $sets));

return array_merge(...$found);
}
Expand Down
Loading