Skip to content
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
13 changes: 12 additions & 1 deletion src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Php\Pie;

use Composer\Factory;
use Composer\Util\Platform as ComposerPlatform;
use Illuminate\Container\Container as IlluminateContainer;
use Php\Pie\Building\Build;
Expand Down Expand Up @@ -37,6 +38,7 @@
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -77,7 +79,16 @@ static function () {
return $input;
},
);
$container->instance(OutputInterface::class, new ConsoleOutput());
$container->singleton(
OutputInterface::class,
static function (): OutputInterface {
return new ConsoleOutput(
ConsoleOutput::VERBOSITY_NORMAL,
null,
new OutputFormatter(false, Factory::createAdditionalStyles()),
);
},
);
$container->singleton(EventDispatcher::class, static function () {
$displayedBanner = false;
$eventDispatcher = new EventDispatcher();
Expand Down
4 changes: 1 addition & 3 deletions src/DependencyResolver/UnableToResolveRequirement.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
use Php\Pie\ComposerIntegration\QuieterConsoleIO;
use RuntimeException;

use function array_map;
use function count;
use function implode;
use function sprintf;
use function strip_tags;

class UnableToResolveRequirement extends RuntimeException
{
Expand All @@ -33,7 +31,7 @@ public static function fromRequirement(
$requestedPackageAndVersion->package,
$requestedPackageAndVersion->version !== null ? sprintf('version %s', $requestedPackageAndVersion->version) : 'the latest compatible version',
DetermineMinimumStability::fromRequestedVersion($requestedPackageAndVersion->version),
count($errors) ? "\n\n" . implode("\n\n", array_map(static fn ($e) => strip_tags($e), $errors)) : '',
count($errors) ? "\n\n" . implode("\n\n", $errors) : '',
),
$requestedPackageAndVersion,
);
Expand Down
Loading