Skip to content

Commit 18bf857

Browse files
Merge branch '3.4' into 4.4
* 3.4: [PhpUnitBridge] fix installing on PHP 8
2 parents 6745a1e + ef6b98f commit 18bf857

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bin/simple-phpunit.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,9 @@
197197
$passthruOrFail("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
198198
}
199199

200-
if ($info['requires']['php'] !== $phpVersion = preg_replace('{\^([\d\.]++)$}', '>=$1', $info['requires']['php'])) {
201-
$passthruOrFail("$COMPOSER require --no-update \"php:$phpVersion\"");
200+
if (preg_match('{\^(\d++\.\d++)[\d\.]*)$}', $info['requires']['php'], $phpVersion)) {
201+
$passthruOrFail("$COMPOSER config platform.php \"$phpVersion[1].99\"");
202202
}
203-
$passthruOrFail("$COMPOSER config --unset platform.php");
204203
if (file_exists($path = $root.'/vendor/symfony/phpunit-bridge')) {
205204
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");
206205
$passthruOrFail("$COMPOSER config repositories.phpunit-bridge path ".escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, $path)));

0 commit comments

Comments
 (0)