Browse Source
fix(util): Correctly create Reflection of method for PHP 8.3+
Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/49145/head
Joas Schilling
1 year ago
No known key found for this signature in database
GPG Key ID: F72FA5B49FFA96B0
1 changed files with
6 additions and
1 deletions
-
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); |
|
|
|
|