From f59402ee58b659c22c9d173546d7e8da27e82f91 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Tue, 20 Dec 2022 21:25:13 +0100 Subject: [PATCH] phpstan, php-cs-fixer review --- _admin.php | 2 +- _init.php | 2 +- _install.php | 2 +- _widgets.php | 3 ++- inc/class.cinecturlink2.php | 6 +++--- inc/lib.cinecturlink2.list.php | 14 +++++++------- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/_admin.php b/_admin.php index 4091b09..eccef82 100644 --- a/_admin.php +++ b/_admin.php @@ -76,7 +76,7 @@ function cinecturlink2AdminIcon(): string return urldecode(dcPage::getPF('cinecturlink2/icon.svg')); } -function cinecturlink2AdminPerm(): bool +function cinecturlink2AdminPerm(): string { return dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]); } diff --git a/_init.php b/_init.php index 36e9d4d..55ac9c6 100644 --- a/_init.php +++ b/_init.php @@ -17,5 +17,5 @@ if (!defined('DC_RC_PATH')) { class initCinecturlink2 { public const CINECTURLINK_TABLE_NAME = 'cinecturlink2'; - public const CATEGORY_TABLE_NAME = 'cinecturlink2_cat'; + public const CATEGORY_TABLE_NAME = 'cinecturlink2_cat'; } diff --git a/_install.php b/_install.php index 27bc2c6..186556e 100644 --- a/_install.php +++ b/_install.php @@ -16,7 +16,7 @@ if (!defined('DC_CONTEXT_ADMIN')) { try { if (!dcCore::app()->newVersion( - basename(__DIR__), + basename(__DIR__), dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version') )) { return null; diff --git a/_widgets.php b/_widgets.php index 5ce7778..450334f 100644 --- a/_widgets.php +++ b/_widgets.php @@ -163,7 +163,8 @@ class cinecturlink2Widget return null; } - $C2 = new cinecturlink2(); + $C2 = new cinecturlink2(); + $aprams = []; if ($w->category) { if ($w->category == 'null') { diff --git a/inc/class.cinecturlink2.php b/inc/class.cinecturlink2.php index 35dc984..000fd35 100644 --- a/inc/class.cinecturlink2.php +++ b/inc/class.cinecturlink2.php @@ -37,10 +37,10 @@ class cinecturlink2 { dcCore::app()->blog->settings->addNamespace('cinecturlink2'); - $this->con = dcCore::app()->con; - $this->table = dcCore::app()->prefix . initCinecturlink2::CINECTURLINK_TABLE_NAME; + $this->con = dcCore::app()->con; + $this->table = dcCore::app()->prefix . initCinecturlink2::CINECTURLINK_TABLE_NAME; $this->cat_table = dcCore::app()->prefix . initCinecturlink2::CATEGORY_TABLE_NAME; - $this->blog = dcCore::app()->con->escape(dcCore::app()->blog->id); + $this->blog = dcCore::app()->con->escape(dcCore::app()->blog->id); } /** diff --git a/inc/lib.cinecturlink2.list.php b/inc/lib.cinecturlink2.list.php index 5fd1be2..d924895 100644 --- a/inc/lib.cinecturlink2.list.php +++ b/inc/lib.cinecturlink2.list.php @@ -105,10 +105,10 @@ class adminlistCinecturlink2 private function linkLine($checked) { $cols = [ - 'check' => '' . + 'check' => '' . form::checkbox(['entries[]'], $this->rs->link_id, ['checked' => $checked]) . '', - 'title' => '' . + 'title' => '' . '' . html::escapeHTML($this->rs->link_author) . '', - 'desc' => '' . + 'desc' => '' . html::escapeHTML($this->rs->link_desc) . '', - 'link' => '' . + 'link' => '' . '' . __('URL') . ' ' . @@ -129,18 +129,18 @@ class adminlistCinecturlink2 html::escapeHTML($this->rs->link_img) . '">' . __('image') . ' ' . '', - 'cat' => '' . + 'cat' => '' . '' . html::escapeHTML($this->rs->cat_title) . '' . '', - 'note' => '' . + 'note' => '' . '' . html::escapeHTML($this->rs->link_note) . '/20' . '', - 'date' => '' . + 'date' => '' . dt::dt2str( dcCore::app()->blog->settings->system->date_format . ', ' . dcCore::app()->blog->settings->system->time_format, $this->rs->link_upddt,