From af55f653847a83d5d81cf5ea2862d9a46959bdad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 30 Apr 2024 00:06:28 +0200 Subject: [PATCH] Calling new ReflectionMethod with a single argument is deprecated --- tests/Internal/Codebase/InternalCallMapHandlerTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Internal/Codebase/InternalCallMapHandlerTest.php b/tests/Internal/Codebase/InternalCallMapHandlerTest.php index e5f6320fba5..52a17d4b79d 100644 --- a/tests/Internal/Codebase/InternalCallMapHandlerTest.php +++ b/tests/Internal/Codebase/InternalCallMapHandlerTest.php @@ -45,6 +45,7 @@ use const PHP_MAJOR_VERSION; use const PHP_MINOR_VERSION; use const PHP_VERSION; +use const PHP_VERSION_ID; /** @group callmap */ class InternalCallMapHandlerTest extends TestCase @@ -519,7 +520,11 @@ private function getReflectionFunction(string $functionName): ?ReflectionFunctio { try { if (strpos($functionName, '::') !== false) { - return new ReflectionMethod($functionName); + if (PHP_VERSION_ID < 803000) { + [$className, , $methodName] = explode(':', $functionName, 3); + return new ReflectionMethod($className, $methodName); + } + return ReflectionMethod::createFromMethodName($functionName); } /** @var callable-string $functionName */