From 7e4e2ffdf540208b626d55695dc97f6ddd18f6a5 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Fri, 2 Dec 2022 01:17:58 +0100 Subject: [PATCH] fix phpstan and php-cs-fixer errors --- _admin.php | 8 ++++---- _config.php | 6 +++--- inc/class.dc.packman.php | 4 ++-- index.php | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/_admin.php b/_admin.php index 8c47cfd..418e028 100644 --- a/_admin.php +++ b/_admin.php @@ -18,10 +18,10 @@ dcCore::app()->blog->settings->addNamespace('pacKman'); dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void { $favs->register('pacKman', [ - 'title' => __('Packages 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')], - 'large-icon' => [dcPage::getPF('pacKman/icon.svg'), dcPage::getPF('pacKman/icon-dark.svg')], + 'title' => __('Packages 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')], + 'large-icon' => [dcPage::getPF('pacKman/icon.svg'), dcPage::getPF('pacKman/icon-dark.svg')], //'permissions' => dcCore::app()->auth->isSuperAdmin(), ]); }); diff --git a/_config.php b/_config.php index 2a5b69f..877020b 100644 --- a/_config.php +++ b/_config.php @@ -15,7 +15,7 @@ if (!defined('DC_CONTEXT_MODULE')) { } $redir = empty($_REQUEST['redir']) ? - dcCore::app()->admin->list->getURL() . '#plugins' : $_REQUEST['redir']; + dcCore::app()->admin->__get('list')->getURL() . '#plugins' : $_REQUEST['redir']; # -- Get settings -- dcCore::app()->blog->settings->addNamespace('pacKman'); @@ -59,8 +59,8 @@ if (!empty($_POST['save'])) { __('Configuration has been successfully updated.') ); http::redirect( - dcCore::app()->admin->list->getURL('module=pacKman&conf=1&redir=' . - dcCore::app()->admin->list->getRedir()) + dcCore::app()->admin->__get('list')->getURL('module=pacKman&conf=1&redir=' . + dcCore::app()->admin->__get('list')->getRedir()) ); } } catch (Exception $e) { diff --git a/inc/class.dc.packman.php b/inc/class.dc.packman.php index c854dcf..807c086 100644 --- a/inc/class.dc.packman.php +++ b/inc/class.dc.packman.php @@ -84,12 +84,12 @@ class dcPackman $zip->unzip($define, $cache . '/_define.php'); - $modules = new dcModules(dcCore::app()); + $modules = new dcModules(); $modules->requireDefine($cache, $zip_root_dir); if ($modules->moduleExists($zip_root_dir)) { $res[$i] = $modules->getModules($zip_root_dir); } else { - $themes = new dcThemes(dcCore::app()); + $themes = new dcThemes(); $themes->requireDefine($cache, $zip_root_dir); $res[$i] = $themes->getModules($zip_root_dir); } diff --git a/index.php b/index.php index 263e483..b331a9b 100644 --- a/index.php +++ b/index.php @@ -25,8 +25,8 @@ dcCore::app()->blog->settings->addNamespace('pacKman'); $s = dcCore::app()->blog->settings->pacKman; # Modules -if (!isset(dcCore::app()->themes)) { - dcCore::app()->themes = new dcThemes(dcCore::app()); +if (!(dcCore::app()->themes instanceof dcThemes)) { + dcCore::app()->themes = new dcThemes(); dcCore::app()->themes->loadModules(dcCore::app()->blog->themes_path, null); } $themes = dcCore::app()->themes;