From 903583674baa30b3c9d0e7d378f64475189a568f Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 11 Sep 2023 17:08:36 +0900 Subject: [PATCH] refactor: remove version check `PHP_VERSION_ID >= 80000` --- tests/system/Debug/TimerTest.php | 7 +------ tests/system/Helpers/ArrayHelperTest.php | 9 +-------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/system/Debug/TimerTest.php b/tests/system/Debug/TimerTest.php index 54c9fdfccb18..2be069062d9c 100644 --- a/tests/system/Debug/TimerTest.php +++ b/tests/system/Debug/TimerTest.php @@ -13,7 +13,6 @@ use ArgumentCountError; use CodeIgniter\Test\CIUnitTestCase; -use ErrorException; use RuntimeException; /** @@ -172,11 +171,7 @@ public function testRecordThrowsException(): void public function testRecordThrowsErrorOnCallableWithParams(): void { - if (PHP_VERSION_ID >= 80000) { - $this->expectException(ArgumentCountError::class); - } else { - $this->expectException(ErrorException::class); - } + $this->expectException(ArgumentCountError::class); $timer = new Timer(); $timer->record('error', 'strlen'); diff --git a/tests/system/Helpers/ArrayHelperTest.php b/tests/system/Helpers/ArrayHelperTest.php index 4844fe84188e..2c4ce103adc9 100644 --- a/tests/system/Helpers/ArrayHelperTest.php +++ b/tests/system/Helpers/ArrayHelperTest.php @@ -12,7 +12,6 @@ namespace CodeIgniter\Helpers; use CodeIgniter\Test\CIUnitTestCase; -use ErrorException; use ValueError; /** @@ -303,13 +302,7 @@ public function testArraySortByMultipleKeysFailsEmptyParameter(array $data, arra */ public function testArraySortByMultipleKeysFailsInconsistentArraySizes($data): void { - // PHP 8 changes this error type - if (PHP_VERSION_ID >= 80000) { - $this->expectException(ValueError::class); - } else { - $this->expectException(ErrorException::class); - } - + $this->expectException(ValueError::class); $this->expectExceptionMessage('Array sizes are inconsistent'); $sortColumns = [