]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(util): Correctly create Reflection of method for PHP 8.3+
authorJoas Schilling <coding@schilljs.com>
Fri, 8 Nov 2024 10:48:55 +0000 (11:48 +0100)
committerJoas Schilling <coding@schilljs.com>
Fri, 8 Nov 2024 11:59:15 +0000 (12:59 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/legacy/OC_Util.php

index 7b41f797e322a7fa40c5fdec390ebf46e5ca1e74..f82082d3d129fd38091f9baa35d1b5e40a887c8b 100644 (file)
@@ -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);