From: Alexander Ebert Date: Mon, 11 Mar 2024 15:33:36 +0000 (+0100) Subject: Update the shim for the editor suggestions X-Git-Tag: 6.1.0_Alpha_1~148^2~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=856540f962fbaa40fedf60f9f57e0aca22f011c5;p=GitHub%2FWoltLab%2FWCF.git Update the shim for the editor suggestions --- diff --git a/wcfsetup/install/files/lib/action/EditorGetMentionSuggestionsAction.class.php b/wcfsetup/install/files/lib/action/EditorGetMentionSuggestionsAction.class.php index 5f04b4a6d6..a6e401cdea 100644 --- a/wcfsetup/install/files/lib/action/EditorGetMentionSuggestionsAction.class.php +++ b/wcfsetup/install/files/lib/action/EditorGetMentionSuggestionsAction.class.php @@ -5,7 +5,6 @@ namespace wcf\action; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; -use wcf\http\Helper; use wcf\system\endpoint\controller\core\messages\MentionSuggestions; /** @@ -21,22 +20,8 @@ final class EditorGetMentionSuggestionsAction implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { - $reflectionClass = new \ReflectionClass(MentionSuggestions::class); - $relfectionMethod = $reflectionClass->getMethod('mentionSuggestions'); - $parameters = $relfectionMethod->getParameters(); + $controller = new MentionSuggestions(); - \assert(\count($parameters) === 1); - \assert($parameters[0]->getName() === 'parameters'); - - $type = $parameters[0]->getType(); - - \assert($type instanceof \ReflectionNamedType); - - $parameters = Helper::mapQueryParameters( - $request->getQueryParams(), - $type->getName(), - ); - - return (new MentionSuggestions())->mentionSuggestions($parameters); + return $controller($request, []); } }