1
0
Fork 0

Show reason for php version package mismatch due to config.platform

pull/7032/merge
Vic Metcalfe 2018-01-15 09:50:22 -05:00 committed by Jordi Boggiano
parent 842a7ea922
commit fa5a94143a
1 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,7 @@
*/ */
namespace Composer\DependencyResolver; namespace Composer\DependencyResolver;
use Composer\Package\CompletePackageInterface;
/** /**
* Represents a problem detected while solving dependencies * Represents a problem detected while solving dependencies
@ -91,7 +92,13 @@ class Problem
// handle php/hhvm // handle php/hhvm
if ($job['packageName'] === 'php' || $job['packageName'] === 'php-64bit' || $job['packageName'] === 'hhvm') { if ($job['packageName'] === 'php' || $job['packageName'] === 'php-64bit' || $job['packageName'] === 'hhvm') {
$available = $this->pool->whatProvides($job['packageName']); $available = $this->pool->whatProvides($job['packageName']);
$version = count($available) ? $available[0]->getPrettyVersion() : phpversion(); $firstAvailable = reset($available);
$version = count($available) ? $firstAvailable->getPrettyVersion() : phpversion();
if (count($available) && $firstAvailable instanceof CompletePackageInterface) {
$version .= '; ' . $firstAvailable->getDescription();
}
$msg = "\n - This package requires ".$job['packageName'].$this->constraintToText($job['constraint']).' but '; $msg = "\n - This package requires ".$job['packageName'].$this->constraintToText($job['constraint']).' but ';