fix(util): Correctly create Reflection of method for PHP 8.3+

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/49145/head
Joas Schilling 2024-11-08 11:48:55 +07:00
parent 8952a4cb77
commit 34592df186
No known key found for this signature in database
GPG Key ID: F72FA5B49FFA96B0
1 changed files with 6 additions and 1 deletions

@ -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);