diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 79f281595..d79a6444e 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -103,10 +103,7 @@ EOT $repos )); - $phpPackages = $this->repos->findPackages('php'); - $phpPackage = reset($phpPackages); - $phpVersion = $phpPackage->getVersion(); - unset($phpPackage, $phpPackages); + $phpVersion = $this->repos->findPackage('php', '*')->getVersion(); $requirements = $this->determineRequirements($input, $output, $input->getArgument('packages'), $phpVersion); $requireKey = $input->getOption('dev') ? 'require-dev' : 'require';