1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 09:02:59 +00:00

add test and adjust rule error message

This commit is contained in:
Rob Bast 2016-02-05 11:39:14 +01:00
parent 79ac2cac82
commit 94daeca57b
2 changed files with 48 additions and 1 deletions

View file

@ -207,7 +207,9 @@ class Rule
} elseif ($targetName === 'hhvm') {
$text .= ' -> you are running this with PHP and not HHVM.';
} else {
$text .= ' -> your PHP version ('. phpversion() .') or value of "config.platform.php" in composer.json does not satisfy that requirement.';
$available = $pool->whatProvides($targetName);
$version = count($available) ? $available[0]->getPrettyVersion() : phpversion();
$text .= ' -> your PHP version or "config.platform.php" value ('.$version.') does not satisfy that requirement.';
}
} elseif (0 === strpos($targetName, 'ext-')) {
// handle php extensions