[PhpUnitBridge] fix setting platform.php

This commit is contained in:
Nicolas Grekas 2020-05-21 20:33:26 +02:00
parent 5ec5bfb23c
commit dd902d939f
1 changed files with 1 additions and 1 deletions

View File

@ -121,7 +121,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
$passthruOrFail("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
}
if (preg_match('{\^(\d++\.\d++)[\d\.]*$}', $info['requires']['php'], $phpVersion) && version_compare($phpVersion[1], PHP_VERSION, '<')) {
if (preg_match('{\^((\d++\.)\d++)[\d\.]*$}', $info['requires']['php'], $phpVersion) && version_compare($phpVersion[2].'99', PHP_VERSION, '<')) {
$passthruOrFail("$COMPOSER config platform.php \"$phpVersion[1].99\"");
} else {
$passthruOrFail("$COMPOSER config --unset platform.php");