77use PhpMyAdmin \Bookmarks \BookmarkRepository ;
88use PhpMyAdmin \Config ;
99use PhpMyAdmin \Controllers \AbstractController ;
10+ use PhpMyAdmin \Http \Response ;
1011use PhpMyAdmin \Http \ServerRequest ;
1112use PhpMyAdmin \ResponseRenderer ;
1213use PhpMyAdmin \Template ;
@@ -24,7 +25,7 @@ public function __construct(
2425 parent ::__construct ($ response , $ template );
2526 }
2627
27- public function __invoke (ServerRequest $ request ): void
28+ public function __invoke (ServerRequest $ request ): Response | null
2829 {
2930 $ db = $ request ->getParsedBodyParam ('db ' );
3031 $ label = $ request ->getParsedBodyParam ('label ' );
@@ -34,7 +35,7 @@ public function __invoke(ServerRequest $request): void
3435 if (! is_string ($ label ) || ! is_string ($ db ) || ! is_string ($ bookmarkQuery ) || ! is_string ($ shared )) {
3536 $ this ->response ->addJSON ('message ' , __ ('Incomplete params ' ));
3637
37- return ;
38+ return null ;
3839 }
3940
4041 $ bookmark = $ this ->bookmarkRepository ->createBookmark (
@@ -47,7 +48,7 @@ public function __invoke(ServerRequest $request): void
4748 if ($ bookmark === false || ! $ bookmark ->save ()) {
4849 $ this ->response ->addJSON ('message ' , __ ('Failed ' ));
4950
50- return ;
51+ return null ;
5152 }
5253
5354 $ bookmarkFields = [
@@ -60,5 +61,7 @@ public function __invoke(ServerRequest $request): void
6061 $ this ->response ->addJSON ('message ' , __ ('Succeeded ' ));
6162 $ this ->response ->addJSON ('data ' , $ bookmarkFields );
6263 $ this ->response ->addJSON ('isShared ' , $ shared === 'true ' );
64+
65+ return null ;
6366 }
6467}
0 commit comments