From 996511ebc9465318eaf6edcf0ab177a0ad757a91 Mon Sep 17 00:00:00 2001 From: John Rayes Date: Sat, 30 May 2026 22:31:00 -0700 Subject: [PATCH] Further improves getDefinedFunctionsInFile() Support functions with union types and classes that extend fully qualified types --- Sources/Actions/Admin/Maintenance.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Sources/Actions/Admin/Maintenance.php b/Sources/Actions/Admin/Maintenance.php index f58400d53d..cfb9dedbb8 100644 --- a/Sources/Actions/Admin/Maintenance.php +++ b/Sources/Actions/Admin/Maintenance.php @@ -2300,13 +2300,21 @@ protected static function parseIntegrationHook(string $hook, string $rawData): a protected static function getDefinedFunctionsInFile(string $file): array { $source = file_get_contents($file); - // token_get_all() is too slow so use a nice little regex instead. - preg_match_all('/\bnamespace\s++((?P>label)(?:\\\(?P>label))*+)\s*+;|\bclass\s++((?P>label))[\w\s]*+{|\bfunction\s++((?P>label))\s*+\(.*?\)[:\|\w\s]*+{(?(DEFINE)(?