77namespace PHPPgAdmin \Controller ;
88
99use IteratorAggregate ;
10- use PHPPgAdmin \ArrayRecordSet ;
11- use PHPPgAdmin \ContainerUtils ;
12- use PHPPgAdmin \Misc ;
10+ use PHPPgAdmin \Core \ArrayRecordset ;
11+ use PHPPgAdmin \Core \ContainerUtils ;
12+ use PHPPgAdmin \Core \Misc ;
13+ use PHPPgAdmin \Core \ViewManager ;
1314use PHPPgAdmin \Traits \HelperTrait ;
14- use PHPPgAdmin \ViewManager ;
1515use PHPPgAdmin \XHtml ;
1616use PHPPgAdmin \XHtml \HTMLFooterController ;
1717use PHPPgAdmin \XHtml \HTMLHeaderController ;
@@ -244,7 +244,7 @@ public static function isRecordSet($variable)
244244 *
245245 * @param array $tabs The tabs
246246 *
247- * @return ArrayRecordSet filtered tabs in the form of an ArrayRecordSet
247+ * @return ArrayRecordset filtered tabs in the form of an ArrayRecordSet
248248 */
249249 public function adjustTabsForTree (&$ tabs )
250250 {
@@ -257,19 +257,18 @@ public function adjustTabsForTree(&$tabs)
257257 * Produce JSON data for the browser tree.
258258 *
259259 * @param \ADORecordSet|\PHPPgAdmin\Interfaces\RecordSet $_treedata
260- * @param false|string $section
261- * @param bool $print either to return or echo the result
260+ * @param false|string $section
261+ * @param bool $print either to return or echo the result
262+ * @param mixed $attrs
262263 *
263264 * @return (array|bool|string)[]
264265 *
265266 * @psalm-return array<int|string, array<string, mixed>|bool|string>
266267 */
267- public function printTree (&$ _treedata , &$ attrs , $ section , $ print = true )
268+ public function printTree (IteratorAggregate &$ _treedata , &$ attrs , $ section , $ print = true )
268269 {
269- $ tree = $ this ->_getTreeController ();
270+ $ parent = $ this ->_getTreeController ()-> printTree ( $ _treedata , $ attrs , $ section );
270271
271- $ parent = $ tree ->printTree ($ _treedata , $ attrs , $ section );
272-
273272 if ($ print ) {
274273 if (isset ($ _REQUEST ['children ' ])) {
275274 $ children = $ parent ;
@@ -282,6 +281,7 @@ public function printTree(&$_treedata, &$attrs, $section, $print = true)
282281 ->withStatus (200 )
283282 ->withJson ($ parent );
284283 }
284+
285285 return $ parent ;
286286 }
287287
@@ -298,12 +298,11 @@ public function printTrail($trail = [], bool $do_print = true)
298298 $ from = __METHOD__ ;
299299 $ html_trail = $ this ->_getNavbarController ();
300300
301- return tap ( $ html_trail ->printTrail ($ trail ),function (?string $ html ) use ($ do_print ){
302- if ($ do_print ) {
303-
301+ return tap ($ html_trail ->printTrail ($ trail ), static function (?string $ html ) use ($ do_print ) {
302+ if ($ do_print ) {
304303 echo $ html ;
305304 }
306- } );
305+ });
307306 }
308307
309308 /**
@@ -317,24 +316,23 @@ public function printNavLinks(array $navlinks, string $place, array $env = [], $
317316 $ from = __METHOD__ ;
318317 $ footer_controller = $ this ->_getFooterController ();
319318
320- return tap ($ footer_controller ->printNavLinks ($ navlinks , $ place , $ env , $ from ),function (?string $ navLinksHtml ) use ($ do_print ){
321- if ($ do_print ) {
322-
319+ return tap ($ footer_controller ->printNavLinks ($ navlinks , $ place , $ env , $ from ), static function (?string $ navLinksHtml ) use ($ do_print ) {
320+ if ($ do_print ) {
323321 echo $ navLinksHtml ;
324322 }
325- } );
323+ });
326324 }
327325
328326 public function printTabs (string $ tabs , string $ activetab , bool $ do_print = true )
329327 {
330328 $ from = __METHOD__ ;
331329 $ html_trail = $ this ->_getNavbarController ();
332330
333- return tap ($ html_trail ->printTabs ($ tabs , $ activetab , false , $ from ),function (?string $ html ) use ($ do_print ){
334- if ($ do_print ) {
331+ return tap ($ html_trail ->printTabs ($ tabs , $ activetab , false , $ from ), static function (?string $ html ) use ($ do_print ) {
332+ if ($ do_print ) {
335333 echo $ html ;
336334 }
337- } );
335+ });
338336 }
339337
340338 /**
@@ -351,11 +349,11 @@ public function printLink($link, bool $do_print = true, ?string $from = null)
351349
352350 $ html_trail = $ this ->_getNavbarController ();
353351
354- return tap ($ html_trail ->printLink ($ link , $ do_print , $ from ),function (?string $ html ) use ($ do_print ){
355- if ($ do_print ) {
352+ return tap ($ html_trail ->printLink ($ link , $ do_print , $ from ), static function (?string $ html ) use ($ do_print ) {
353+ if ($ do_print ) {
356354 echo $ html ;
357355 }
358- } );
356+ });
359357 }
360358
361359 /**
@@ -394,7 +392,7 @@ public function printFooter(bool $doBody = true, string $template = 'footer.twig
394392
395393 public function printReload ($ database , $ do_print = true )
396394 {
397- return '' ;
395+ return '' ;
398396 }
399397
400398 /**
@@ -443,7 +441,7 @@ public function printHeader(string $title = '', ?string $script = null, bool $do
443441 $ title = '' !== $ title ? $ title : $ this ->headerTitle ();
444442 $ header_controller = $ this ->_getHeaderController ();
445443
446- return $ header_controller ->printHeader ($ title , $ script , $ do_print , $ template );
444+ return $ header_controller ->printHeader ($ title , $ script , $ do_print , $ template );
447445 }
448446
449447 /**
@@ -467,7 +465,7 @@ public function printTitle(string $title, ?string $help = null, bool $do_print =
467465 {
468466 $ header_controller = $ this ->_getHeaderController ();
469467
470- return $ header_controller ->printTitle ($ title , $ help , $ do_print );
468+ return $ header_controller ->printTitle ($ title , $ help , $ do_print );
471469 }
472470
473471 /**
0 commit comments