Skip to content

Commit

Permalink
renames folders to align with namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflabs committed Nov 25, 2021
1 parent f7b0193 commit b74660b
Show file tree
Hide file tree
Showing 174 changed files with 611 additions and 591 deletions.
3 changes: 1 addition & 2 deletions assets/js/jstree_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ $('#lazy').on('state_ready.jstree', function (e, data) {
});
});
$('#lazy').on('loaded.jstree', function (e, data) {
console.log('loaded');
$('#lazy').data('jstree').show_dots();
data.instance.show_dots();
});
$('#lazy').on('click', '.jstree-anchor', function () {
console.log(this);
Expand Down
12 changes: 1 addition & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,7 @@
},
"autoload": {
"psr-4": {
"PHPPgAdmin\\": "src/classes",
"PHPPgAdmin\\Controller\\": "src/controllers",
"PHPPgAdmin\\Middleware\\": "src/middleware",
"PHPPgAdmin\\Database\\": "src/database",
"PHPPgAdmin\\XHtml\\": "src/xhtml",
"PHPPgAdmin\\Decorators\\": "src/decorators",
"PHPPgAdmin\\Traits\\": "src/traits",
"PHPPgAdmin\\Database\\Traits\\": "src/database/databasetraits",
"PHPPgAdmin\\Help\\": "src/help",
"PHPPgAdmin\\Translations\\": "src/translations",
"PHPPgAdmin\\Interfaces\\": "src/interfaces"
"PHPPgAdmin\\": "src"
},
"files": [
"src/lib.inc.php",
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ parameters:
- assets/*
- temp/*
- vendor/*
- src/classes/ADO*
- src/Core/ADO*
- src/router.php
reportUnmatchedIgnoredErrors: false

Expand Down
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ignoreFiles>
<directory name="vendor" />
<directory name="temp" />
<directory name="src/translations" />
<directory name="src/Translations" />
</ignoreFiles>
</projectFiles>

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ public function doDefault($msg = '')
'content' => $this->lang['strcreateaggregate'],
],
];
return $this->printNavLinks($navlinks, $this->table_place, \get_defined_vars());

return $this->printNavLinks($navlinks, $this->table_place, \get_defined_vars());
}

/**
Expand Down Expand Up @@ -676,6 +677,6 @@ public function doProperties($msg = '')
'content' => $this->lang['strdrop'],
];

return $this->printNavLinks($navlinks, 'aggregates-properties', \get_defined_vars());
return $this->printNavLinks($navlinks, 'aggregates-properties', \get_defined_vars());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ public function doDefault($msg = '')
'content' => $this->lang['strcreatedatabase'],
],
];
return $this->printNavLinks($navlinks, $this->table_place, \get_defined_vars());

return $this->printNavLinks($navlinks, $this->table_place, \get_defined_vars());
}

/**
Expand All @@ -255,6 +256,7 @@ public function doTree()
$attrs = [
'text' => Decorator::field('datname'),
'icon' => 'Database',

'toolTip' => Decorator::field('datcomment'),
'action' => Decorator::redirecturl('redirect', $reqvars, ['subject' => 'database', 'database' => Decorator::field('datname')]),
'branch' => Decorator::url('/src/views/database', $reqvars, ['action' => 'tree', 'database' => Decorator::field('datname')]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
namespace PHPPgAdmin\Controller;

use IteratorAggregate;
use PHPPgAdmin\ArrayRecordSet;
use PHPPgAdmin\ContainerUtils;
use PHPPgAdmin\Misc;
use PHPPgAdmin\Core\ArrayRecordset;
use PHPPgAdmin\Core\ContainerUtils;
use PHPPgAdmin\Core\Misc;
use PHPPgAdmin\Core\ViewManager;
use PHPPgAdmin\Traits\HelperTrait;
use PHPPgAdmin\ViewManager;
use PHPPgAdmin\XHtml;
use PHPPgAdmin\XHtml\HTMLFooterController;
use PHPPgAdmin\XHtml\HTMLHeaderController;
Expand Down Expand Up @@ -244,7 +244,7 @@ public static function isRecordSet($variable)
*
* @param array $tabs The tabs
*
* @return ArrayRecordSet filtered tabs in the form of an ArrayRecordSet
* @return ArrayRecordset filtered tabs in the form of an ArrayRecordSet
*/
public function adjustTabsForTree(&$tabs)
{
Expand All @@ -257,19 +257,18 @@ public function adjustTabsForTree(&$tabs)
* Produce JSON data for the browser tree.
*
* @param \ADORecordSet|\PHPPgAdmin\Interfaces\RecordSet $_treedata
* @param false|string $section
* @param bool $print either to return or echo the result
* @param false|string $section
* @param bool $print either to return or echo the result
* @param mixed $attrs
*
* @return (array|bool|string)[]
*
* @psalm-return array<int|string, array<string, mixed>|bool|string>
*/
public function printTree(&$_treedata, &$attrs, $section, $print = true)
public function printTree(IteratorAggregate &$_treedata, &$attrs, $section, $print = true)
{
$tree = $this->_getTreeController();
$parent = $this->_getTreeController()->printTree($_treedata, $attrs, $section);

$parent= $tree->printTree($_treedata, $attrs, $section);

if ($print) {
if (isset($_REQUEST['children'])) {
$children = $parent;
Expand All @@ -282,6 +281,7 @@ public function printTree(&$_treedata, &$attrs, $section, $print = true)
->withStatus(200)
->withJson($parent);
}

return $parent;
}

Expand All @@ -298,12 +298,11 @@ public function printTrail($trail = [], bool $do_print = true)
$from = __METHOD__;
$html_trail = $this->_getNavbarController();

return tap( $html_trail->printTrail($trail ),function(?string $html) use ($do_print){
if($do_print) {

return tap($html_trail->printTrail($trail), static function (?string $html) use ($do_print) {
if ($do_print) {
echo $html;
}
} );
});
}

/**
Expand All @@ -317,24 +316,23 @@ public function printNavLinks(array $navlinks, string $place, array $env = [], $
$from = __METHOD__;
$footer_controller = $this->_getFooterController();

return tap($footer_controller->printNavLinks($navlinks, $place, $env, $from),function(?string $navLinksHtml) use ($do_print){
if($do_print) {

return tap($footer_controller->printNavLinks($navlinks, $place, $env, $from), static function (?string $navLinksHtml) use ($do_print) {
if ($do_print) {
echo $navLinksHtml;
}
} );
});
}

public function printTabs(string $tabs, string $activetab, bool $do_print = true)
{
$from = __METHOD__;
$html_trail = $this->_getNavbarController();

return tap($html_trail->printTabs($tabs, $activetab, false, $from),function(?string $html) use ($do_print){
if($do_print) {
return tap($html_trail->printTabs($tabs, $activetab, false, $from), static function (?string $html) use ($do_print) {
if ($do_print) {
echo $html;
}
} );
});
}

/**
Expand All @@ -351,11 +349,11 @@ public function printLink($link, bool $do_print = true, ?string $from = null)

$html_trail = $this->_getNavbarController();

return tap($html_trail->printLink($link, $do_print, $from),function(?string $html) use ($do_print){
if($do_print) {
return tap($html_trail->printLink($link, $do_print, $from), static function (?string $html) use ($do_print) {
if ($do_print) {
echo $html;
}
} );
});
}

/**
Expand Down Expand Up @@ -394,7 +392,7 @@ public function printFooter(bool $doBody = true, string $template = 'footer.twig

public function printReload($database, $do_print = true)
{
return '';
return '';
}

/**
Expand Down Expand Up @@ -443,7 +441,7 @@ public function printHeader(string $title = '', ?string $script = null, bool $do
$title = '' !== $title ? $title : $this->headerTitle();
$header_controller = $this->_getHeaderController();

return $header_controller->printHeader($title, $script, $do_print, $template);
return $header_controller->printHeader($title, $script, $do_print, $template);
}

/**
Expand All @@ -467,7 +465,7 @@ public function printTitle(string $title, ?string $help = null, bool $do_print =
{
$header_controller = $this->_getHeaderController();

return $header_controller->printTitle($title, $help, $do_print);
return $header_controller->printTitle($title, $help, $do_print);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace PHPPgAdmin\Controller;

use PHPPgAdmin\ArrayRecordSet;
use PHPPgAdmin\Core\ArrayRecordset;
use PHPPgAdmin\Decorators\Decorator;

/**
Expand Down Expand Up @@ -68,7 +68,7 @@ public function doDefault()
*/
public function doTree()
{
$treedata = new ArrayRecordSet([]);
$treedata = new ArrayRecordset([]);
$reqvars = [];
$action = Decorator::url('/src/views/servers');
$branch = Decorator::url('/src/views/servers', $reqvars, ['action' => 'tree']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public function doDefault($msg = '')
if (self::isRecordset($casts)) {
echo $this->printTable($casts, $columns, $actions, 'casts-casts', $this->lang['strnocasts']);
}

return '';
}

Expand Down
Loading

0 comments on commit b74660b

Please sign in to comment.