From 63a3170dd6283bcd1a92d97e4503fc7cf15ee4aa Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 12 Nov 2024 17:59:35 +0000 Subject: [PATCH] Remove now-unnecessary PHP <8.2 code --- .../LocateDefinedSymbolsFromExtensions.php | 7 ----- ...LocateDefinedSymbolsFromExtensionsTest.php | 28 ------------------- 2 files changed, 35 deletions(-) diff --git a/src/ComposerRequireChecker/DefinedSymbolsLocator/LocateDefinedSymbolsFromExtensions.php b/src/ComposerRequireChecker/DefinedSymbolsLocator/LocateDefinedSymbolsFromExtensions.php index 6db1d2e5..dd861f14 100644 --- a/src/ComposerRequireChecker/DefinedSymbolsLocator/LocateDefinedSymbolsFromExtensions.php +++ b/src/ComposerRequireChecker/DefinedSymbolsLocator/LocateDefinedSymbolsFromExtensions.php @@ -11,8 +11,6 @@ use function array_keys; use function array_merge; -use const PHP_VERSION_ID; - class LocateDefinedSymbolsFromExtensions { /** @@ -38,11 +36,6 @@ public function __invoke(array $extensionNames): array foreach ($extensionNames as $extensionName) { $extensionName = self::ALTERNATIVES[$extensionName] ?? $extensionName; - // @infection-ignore-all LessThan No point in testing this on 8.2.0 specifically - if ($extensionName === 'random' && PHP_VERSION_ID < 80200) { - continue; - } - try { $extensionReflection = new ReflectionExtension($extensionName); $definedSymbols = array_merge( diff --git a/test/ComposerRequireCheckerTest/DefinedSymbolsLocator/LocateDefinedSymbolsFromExtensionsTest.php b/test/ComposerRequireCheckerTest/DefinedSymbolsLocator/LocateDefinedSymbolsFromExtensionsTest.php index 57616411..7e2e8ad7 100644 --- a/test/ComposerRequireCheckerTest/DefinedSymbolsLocator/LocateDefinedSymbolsFromExtensionsTest.php +++ b/test/ComposerRequireCheckerTest/DefinedSymbolsLocator/LocateDefinedSymbolsFromExtensionsTest.php @@ -11,8 +11,6 @@ use function count; use function in_array; -use const PHP_VERSION_ID; - final class LocateDefinedSymbolsFromExtensionsTest extends TestCase { private LocateDefinedSymbolsFromExtensions $locator; @@ -72,36 +70,10 @@ public function testCanHandleMultipleExtensions(): void $this->assertSame(array_merge($coreSymbols, $standardSymbols), $combinedSymbols); } - public function testDoesNotCollectAnySymbolsForTheRandomExtensionOnPhpVersionsLowerThan82(): void - { - if (PHP_VERSION_ID >= 80200) { - $this->markTestSkipped('This test is only relevant for PHP versions lower than 8.2'); - } - - $symbols = $this->locator->__invoke(['random']); - - $this->assertEmpty($symbols); - } - public function testCollectsSymbolsForTheRandomExtensionOnPhpVersions82AndHigher(): void { - if (PHP_VERSION_ID < 80200) { - $this->markTestSkipped('This test is only relevant for PHP versions 8.2 and higher'); - } - $symbols = $this->locator->__invoke(['random']); $this->assertNotEmpty($symbols); } - - public function testDoesNotStopCollectingSymbolsWhenSkippingTheRandomExtension(): void - { - if (PHP_VERSION_ID >= 80200) { - $this->markTestSkipped('This test is only relevant for PHP versions lower than 8.2'); - } - - $symbols = $this->locator->__invoke(['random', 'Core']); - - $this->assertNotEmpty($symbols); - } }