From 34592df1861e33ddcca0c6e2e107cef6d4631c85 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 8 Nov 2024 11:48:55 +0100 Subject: [PATCH] fix(util): Correctly create Reflection of method for PHP 8.3+ Signed-off-by: Joas Schilling --- lib/private/legacy/OC_Util.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 7b41f797e32..f82082d3d12 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -878,7 +878,12 @@ class OC_Util { * @return bool */ public static function isAnnotationsWorking() { - $reflection = new \ReflectionMethod(__METHOD__); + if (PHP_VERSION_ID >= 80300) { + /** @psalm-suppress UndefinedMethod */ + $reflection = \ReflectionMethod::createFromMethodName(__METHOD__); + } else { + $reflection = new \ReflectionMethod(__METHOD__); + } $docs = $reflection->getDocComment(); return (is_string($docs) && strlen($docs) > 50); -- 2.39.5