[PhpUnitBridge] fix installing on PHP 8 (ter)

This commit is contained in:
Nicolas Grekas 2020-05-21 00:01:37 +02:00
parent c101259192
commit 5ec5bfb23c
1 changed files with 3 additions and 1 deletions

View File

@ -121,8 +121,10 @@ 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)) {
if (preg_match('{\^(\d++\.\d++)[\d\.]*$}', $info['requires']['php'], $phpVersion) && version_compare($phpVersion[1], PHP_VERSION, '<')) {
$passthruOrFail("$COMPOSER config platform.php \"$phpVersion[1].99\"");
} else {
$passthruOrFail("$COMPOSER config --unset platform.php");
}
if (file_exists($path = $root.'/vendor/symfony/phpunit-bridge')) {
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");