code review phpstan and php-cs-fixer

This commit is contained in:
Jean-Christian Paul Denis 2022-12-22 22:59:31 +01:00
parent 872bcb551f
commit 2d2c735fae
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
4 changed files with 25 additions and 25 deletions

View File

@ -15,18 +15,18 @@ 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 --
$s = dcCore::app()->blog->settings->addNamespace(basename(__DIR__)); $s = dcCore::app()->blog->settings->addNamespace(basename(__DIR__));
$lb_overwrite = (bool) $s->overwrite; $lb_overwrite = (bool) $s->get('overwrite');
$lb_write_full = (bool) $s->write_full; $lb_write_full = (bool) $s->get('write_full');
$lb_write_php = (bool) $s->write_php; $lb_write_php = (bool) $s->get('write_php');
$lb_write_js = (bool) $s->write_js; $lb_write_js = (bool) $s->get('write_js');
$lb_exclude_locales = (bool) $s->exclude_locales; $lb_exclude_locales = (bool) $s->get('exclude_locales');
$lb_license_name = licenseBootstrap::getName($s->license_name); $lb_license_name = licenseBootstrap::getName($s->get('license_name'));
$lb_license_head = licenseBootstrap::gethead($s->license_name, licenseBootstrap::decode($s->license_head)); $lb_license_head = licenseBootstrap::gethead($s->get('license_name'), licenseBootstrap::decode($s->get('license_head')));
# -- Set settings -- # -- Set settings --
if (!empty($_POST['save'])) { if (!empty($_POST['save'])) {
@ -51,8 +51,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=' . basename(__DIR__) . '&conf=1&redir=' . dcCore::app()->admin->__get('list')->getURL('module=' . basename(__DIR__) . '&conf=1&redir=' .
dcCore::app()->admin->list->getRedir()) dcCore::app()->admin->__get('list')->getRedir())
); );
} catch (Exception $e) { } catch (Exception $e) {
dcCore::app()->error->add($e->getMessage()); dcCore::app()->error->add($e->getMessage());

View File

@ -74,7 +74,7 @@ $mod_conf = [
try { try {
# Check module version # Check module version
if (!dcCore::app()->newVersion( if (!dcCore::app()->newVersion(
basename(__DIR__), basename(__DIR__),
dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version') dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version')
)) { )) {
return null; return null;

View File

@ -36,22 +36,22 @@ class licenseBootstrap
$module $module
); );
if ($s->write_full) { if ($s->get('write_full')) {
licenseBootstrap::writeFullContent( licenseBootstrap::writeFullContent(
$s->license_name, $s->get('license_name'),
$module, $module,
$s->overwrite $s->get('overwrite')
); );
} }
licenseBootstrap::writeHeadContent( licenseBootstrap::writeHeadContent(
$s->license_name, $s->get('license_name'),
licenseBootstrap::decode($s->license_head), licenseBootstrap::decode($s->get('license_head')),
$module, $module,
dcCore::app()->auth, dcCore::app()->auth,
$s->overwrite, $s->get('overwrite'),
$s->write_php, $s->get('write_php'),
$s->write_js, $s->get('write_js'),
$s->exclude_locales $s->get('exclude_locales')
); );
# --BEHAVIOR-- licenseBootstrapAfterAddLicense # --BEHAVIOR-- licenseBootstrapAfterAddLicense
@ -288,10 +288,10 @@ class licenseBootstrap
/** /**
* Replace info in license * Replace info in license
* *
* @param string $content License content * @param string $content License content
* @param array $module Module info * @param array $module Module info
* @param array $user User info * @param object $user User info
* @return string License content * @return string License content
*/ */
protected static function replaceInfo($content, $module, $user) protected static function replaceInfo($content, $module, $user)
{ {

View File

@ -24,7 +24,7 @@ $type = isset($_POST['type']) && in_array($_POST['type'], ['plugins', 'themes'
$s = dcCore::app()->blog->settings->addNamespace(basename(__DIR__)); $s = dcCore::app()->blog->settings->addNamespace(basename(__DIR__));
# Modules # Modules
if (!isset(dcCore::app()->themes)) { if (!(dcCore::app()->themes instanceof dcThemes)) {
dcCore::app()->themes = new dcThemes(); 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);
} }