fix phpstan and php-cs-fixer errors

This commit is contained in:
Jean-Christian Paul Denis 2022-12-02 01:17:58 +01:00
parent fe949a9236
commit 7e4e2ffdf5
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
4 changed files with 11 additions and 11 deletions

View File

@ -18,10 +18,10 @@ dcCore::app()->blog->settings->addNamespace('pacKman');
dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void { dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void {
$favs->register('pacKman', [ $favs->register('pacKman', [
'title' => __('Packages repository'), 'title' => __('Packages repository'),
'url' => dcCore::app()->adminurl->get('admin.plugin.pacKman') . '#packman-repository-repository', 'url' => dcCore::app()->adminurl->get('admin.plugin.pacKman') . '#packman-repository-repository',
'small-icon' => [dcPage::getPF('pacKman/icon.svg'), dcPage::getPF('pacKman/icon-dark.svg')], 'small-icon' => [dcPage::getPF('pacKman/icon.svg'), dcPage::getPF('pacKman/icon-dark.svg')],
'large-icon' => [dcPage::getPF('pacKman/icon.svg'), dcPage::getPF('pacKman/icon-dark.svg')], 'large-icon' => [dcPage::getPF('pacKman/icon.svg'), dcPage::getPF('pacKman/icon-dark.svg')],
//'permissions' => dcCore::app()->auth->isSuperAdmin(), //'permissions' => dcCore::app()->auth->isSuperAdmin(),
]); ]);
}); });

View File

@ -15,7 +15,7 @@ if (!defined('DC_CONTEXT_MODULE')) {
} }
$redir = empty($_REQUEST['redir']) ? $redir = empty($_REQUEST['redir']) ?
dcCore::app()->admin->list->getURL() . '#plugins' : $_REQUEST['redir']; dcCore::app()->admin->__get('list')->getURL() . '#plugins' : $_REQUEST['redir'];
# -- Get settings -- # -- Get settings --
dcCore::app()->blog->settings->addNamespace('pacKman'); dcCore::app()->blog->settings->addNamespace('pacKman');
@ -59,8 +59,8 @@ if (!empty($_POST['save'])) {
__('Configuration has been successfully updated.') __('Configuration has been successfully updated.')
); );
http::redirect( http::redirect(
dcCore::app()->admin->list->getURL('module=pacKman&conf=1&redir=' . dcCore::app()->admin->__get('list')->getURL('module=pacKman&conf=1&redir=' .
dcCore::app()->admin->list->getRedir()) dcCore::app()->admin->__get('list')->getRedir())
); );
} }
} catch (Exception $e) { } catch (Exception $e) {

View File

@ -84,12 +84,12 @@ class dcPackman
$zip->unzip($define, $cache . '/_define.php'); $zip->unzip($define, $cache . '/_define.php');
$modules = new dcModules(dcCore::app()); $modules = new dcModules();
$modules->requireDefine($cache, $zip_root_dir); $modules->requireDefine($cache, $zip_root_dir);
if ($modules->moduleExists($zip_root_dir)) { if ($modules->moduleExists($zip_root_dir)) {
$res[$i] = $modules->getModules($zip_root_dir); $res[$i] = $modules->getModules($zip_root_dir);
} else { } else {
$themes = new dcThemes(dcCore::app()); $themes = new dcThemes();
$themes->requireDefine($cache, $zip_root_dir); $themes->requireDefine($cache, $zip_root_dir);
$res[$i] = $themes->getModules($zip_root_dir); $res[$i] = $themes->getModules($zip_root_dir);
} }

View File

@ -25,8 +25,8 @@ dcCore::app()->blog->settings->addNamespace('pacKman');
$s = dcCore::app()->blog->settings->pacKman; $s = dcCore::app()->blog->settings->pacKman;
# Modules # Modules
if (!isset(dcCore::app()->themes)) { if (!(dcCore::app()->themes instanceof dcThemes)) {
dcCore::app()->themes = new dcThemes(dcCore::app()); dcCore::app()->themes = new dcThemes();
dcCore::app()->themes->loadModules(dcCore::app()->blog->themes_path, null); dcCore::app()->themes->loadModules(dcCore::app()->blog->themes_path, null);
} }
$themes = dcCore::app()->themes; $themes = dcCore::app()->themes;