From d5245387f391ec700c2202c43be87b010b2f0e09 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 26 Oct 2020 10:04:10 +0100 Subject: [PATCH] Fix error message --- src/Composer/Command/InitCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 22f153faa..a07162119 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -741,9 +741,9 @@ EOT // Check whether the PHP version was the problem if (true !== $ignorePlatformReqs && $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, true)) { throw new \InvalidArgumentException(sprintf( - 'Package %s at version %s has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version', + 'Package %s%s has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version', $name, - $requiredVersion + $requiredVersion ? ' at version '.$requiredVersion : '', )); } // Check whether the required version was the problem @@ -751,7 +751,7 @@ EOT throw new \InvalidArgumentException(sprintf( 'Could not find package %s in a version matching %s', $name, - $requiredVersion + $requiredVersion ?: '*', )); } // Check whether the PHP version was the problem for all versions