Skip to content

Commit

Permalink
remove amp
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Nov 22, 2023
1 parent a56faaa commit a98e98f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 62 deletions.
39 changes: 0 additions & 39 deletions src/Amp/FailureCollector.php

This file was deleted.

24 changes: 1 addition & 23 deletions src/Console/Command/Compile.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace KevinGH\Box\Console\Command;

use Amp\MultiReasonException;
use DateTimeImmutable;
use DateTimeInterface;
use Fidry\Console\Command\Command;
Expand All @@ -26,7 +25,6 @@
use Fidry\FileSystem\FileSystem;
use Fidry\FileSystem\FS;
use Humbug\PhpScoper\Symbol\SymbolsRegistry;
use KevinGH\Box\Amp\FailureCollector;
use KevinGH\Box\Box;
use KevinGH\Box\Compactor\Compactor;
use KevinGH\Box\Composer\CompilerPsrLogger;
Expand Down Expand Up @@ -484,7 +482,7 @@ private static function addFiles(Configuration $config, Box $box, CompilerLogger

$count = count($config->getFiles());

self::addFilesWithErrorHandling($config, $box, $io);
$box->addFiles($config->getFiles(), false);

$logger->log(
CompilerLogger::CHEVRON_PREFIX,
Expand All @@ -494,26 +492,6 @@ private static function addFiles(Configuration $config, Box $box, CompilerLogger
);
}

private static function addFilesWithErrorHandling(Configuration $config, Box $box, IO $io): void
{
try {
$box->addFiles($config->getFiles(), false);

return;
} catch (MultiReasonException $ampFailure) {
// Continue
}

// This exception is handled a different way to give me meaningful feedback to the user
$io->error([
'An Amp\Parallel error occurred. To diagnostic if it is an Amp error related, you may try again with "--no-parallel".',
'Reason(s) of the failure:',
...FailureCollector::collectReasons($ampFailure),
]);

throw $ampFailure;
}

private static function registerMainScript(Configuration $config, Box $box, CompilerLogger $logger): ?string
{
if (false === $config->hasMainScript()) {
Expand Down

0 comments on commit a98e98f

Please sign in to comment.