Skip to content

Commit b74660b

Browse files
committed
renames folders to align with namespaces
1 parent f7b0193 commit b74660b

File tree

174 files changed

+611
-591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+611
-591
lines changed

assets/js/jstree_events.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ $('#lazy').on('state_ready.jstree', function (e, data) {
7272
});
7373
});
7474
$('#lazy').on('loaded.jstree', function (e, data) {
75-
console.log('loaded');
76-
$('#lazy').data('jstree').show_dots();
75+
data.instance.show_dots();
7776
});
7877
$('#lazy').on('click', '.jstree-anchor', function () {
7978
console.log(this);

composer.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,7 @@
4848
},
4949
"autoload": {
5050
"psr-4": {
51-
"PHPPgAdmin\\": "src/classes",
52-
"PHPPgAdmin\\Controller\\": "src/controllers",
53-
"PHPPgAdmin\\Middleware\\": "src/middleware",
54-
"PHPPgAdmin\\Database\\": "src/database",
55-
"PHPPgAdmin\\XHtml\\": "src/xhtml",
56-
"PHPPgAdmin\\Decorators\\": "src/decorators",
57-
"PHPPgAdmin\\Traits\\": "src/traits",
58-
"PHPPgAdmin\\Database\\Traits\\": "src/database/databasetraits",
59-
"PHPPgAdmin\\Help\\": "src/help",
60-
"PHPPgAdmin\\Translations\\": "src/translations",
61-
"PHPPgAdmin\\Interfaces\\": "src/interfaces"
51+
"PHPPgAdmin\\": "src"
6252
},
6353
"files": [
6454
"src/lib.inc.php",

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ parameters:
2525
- assets/*
2626
- temp/*
2727
- vendor/*
28-
- src/classes/ADO*
28+
- src/Core/ADO*
2929
- src/router.php
3030
reportUnmatchedIgnoredErrors: false
3131

psalm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ignoreFiles>
88
<directory name="vendor" />
99
<directory name="temp" />
10-
<directory name="src/translations" />
10+
<directory name="src/Translations" />
1111
</ignoreFiles>
1212
</projectFiles>
1313

src/controllers/AggregatesController.php renamed to src/Controller/AggregatesController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ public function doDefault($msg = '')
184184
'content' => $this->lang['strcreateaggregate'],
185185
],
186186
];
187-
return $this->printNavLinks($navlinks, $this->table_place, \get_defined_vars());
187+
188+
return $this->printNavLinks($navlinks, $this->table_place, \get_defined_vars());
188189
}
189190

190191
/**
@@ -676,6 +677,6 @@ public function doProperties($msg = '')
676677
'content' => $this->lang['strdrop'],
677678
];
678679

679-
return $this->printNavLinks($navlinks, 'aggregates-properties', \get_defined_vars());
680+
return $this->printNavLinks($navlinks, 'aggregates-properties', \get_defined_vars());
680681
}
681682
}

src/controllers/AlldbController.php renamed to src/Controller/AlldbController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ public function doDefault($msg = '')
238238
'content' => $this->lang['strcreatedatabase'],
239239
],
240240
];
241-
return $this->printNavLinks($navlinks, $this->table_place, \get_defined_vars());
241+
242+
return $this->printNavLinks($navlinks, $this->table_place, \get_defined_vars());
242243
}
243244

244245
/**
@@ -255,6 +256,7 @@ public function doTree()
255256
$attrs = [
256257
'text' => Decorator::field('datname'),
257258
'icon' => 'Database',
259+
258260
'toolTip' => Decorator::field('datcomment'),
259261
'action' => Decorator::redirecturl('redirect', $reqvars, ['subject' => 'database', 'database' => Decorator::field('datname')]),
260262
'branch' => Decorator::url('/src/views/database', $reqvars, ['action' => 'tree', 'database' => Decorator::field('datname')]),

src/controllers/BaseController.php renamed to src/Controller/BaseController.php

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
namespace PHPPgAdmin\Controller;
88

99
use 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;
1314
use PHPPgAdmin\Traits\HelperTrait;
14-
use PHPPgAdmin\ViewManager;
1515
use PHPPgAdmin\XHtml;
1616
use PHPPgAdmin\XHtml\HTMLFooterController;
1717
use 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
/**

src/controllers/BrowserController.php renamed to src/Controller/BrowserController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace PHPPgAdmin\Controller;
88

9-
use PHPPgAdmin\ArrayRecordSet;
9+
use PHPPgAdmin\Core\ArrayRecordset;
1010
use PHPPgAdmin\Decorators\Decorator;
1111

1212
/**
@@ -68,7 +68,7 @@ public function doDefault()
6868
*/
6969
public function doTree()
7070
{
71-
$treedata = new ArrayRecordSet([]);
71+
$treedata = new ArrayRecordset([]);
7272
$reqvars = [];
7373
$action = Decorator::url('/src/views/servers');
7474
$branch = Decorator::url('/src/views/servers', $reqvars, ['action' => 'tree']);

src/controllers/CastsController.php renamed to src/Controller/CastsController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public function doDefault($msg = '')
9393
if (self::isRecordset($casts)) {
9494
echo $this->printTable($casts, $columns, $actions, 'casts-casts', $this->lang['strnocasts']);
9595
}
96+
9697
return '';
9798
}
9899

0 commit comments

Comments
 (0)