Skip to content

Commit ef6b98f

Browse files
[PhpUnitBridge] fix installing on PHP 8
1 parent a512538 commit ef6b98f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bin/simple-phpunit

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,9 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
121121
$passthruOrFail("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
122122
}
123123

124-
if ($info['requires']['php'] !== $phpVersion = preg_replace('{\^([\d\.]++)$}', '>=$1', $info['requires']['php'])) {
125-
$passthruOrFail("$COMPOSER require --no-update \"php:$phpVersion\"");
124+
if (preg_match('{\^(\d++\.\d++)[\d\.]*)$}', $info['requires']['php'], $phpVersion)) {
125+
$passthruOrFail("$COMPOSER config platform.php \"$phpVersion[1].99\"");
126126
}
127-
$passthruOrFail("$COMPOSER config --unset platform.php");
128127
if (file_exists($path = $root.'/vendor/symfony/phpunit-bridge')) {
129128
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");
130129
$passthruOrFail("$COMPOSER config repositories.phpunit-bridge path ".escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, $path)));

0 commit comments

Comments
 (0)