Skip to content

Commit a573432

Browse files
committed
fix: better PHPUnit version detection
1 parent 111bddb commit a573432

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Bridge/Symfony/Bundle/Test/Constraint/ArraySubset.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Constraint;
1515

16+
use PHPUnit\Runner\Version;
1617
use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
1718
use SebastianBergmann\Comparator\ComparisonFailure as LegacyComparisonFailure;
1819

@@ -21,7 +22,7 @@ class_alias(LegacyComparisonFailure::class, 'PHPUnit\SebastianBergmann\Comparato
2122
}
2223

2324
// Aliases as string to avoid loading the class
24-
if (\PHP_VERSION_ID >= 80000 || (float) getenv('SYMFONY_PHPUNIT_VERSION') > 8) {
25+
if (\PHP_VERSION_ID >= 80000 || (float) Version::series() >= 9) {
2526
class_alias('ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Constraint\ArraySubsetV9', 'ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Constraint\ArraySubset');
2627
} else {
2728
class_alias('ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Constraint\ArraySubsetLegacy', 'ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Constraint\ArraySubset');

0 commit comments

Comments
 (0)