fix PSR12 CS

master
Jean-Christian Paul Denis 2021-11-06 14:46:37 +01:00
parent e68a211f8f
commit e40adc6be7
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
7 changed files with 33 additions and 35 deletions

View File

@ -83,7 +83,7 @@ class epcAdminBehaviors
public static function adminBlogPreferencesForm(dcCore $core, dcSettings $blog_settings)
{
$active = (boolean) $blog_settings->enhancePostContent->enhancePostContent_active;
$active = (bool) $blog_settings->enhancePostContent->enhancePostContent_active;
$allowedtplvalues = libEPC::blogAllowedTplValues();
$allowedpubpages = libEPC::blogAllowedPubPages();

View File

@ -118,13 +118,13 @@ abstract class epcFilter
$opt = [];
}
if (isset($opt['nocase'])) {
$this->settings['nocase'] = (boolean) $opt['nocase'];
$this->settings['nocase'] = (bool) $opt['nocase'];
}
if (isset($opt['plural'])) {
$this->settings['plural'] = (boolean) $opt['plural'];
$this->settings['plural'] = (bool) $opt['plural'];
}
if (isset($opt['limit'])) {
$this->settings['limit'] = abs((integer) $opt['limit']);
$this->settings['limit'] = abs((int) $opt['limit']);
}
if (isset($opt['style']) && is_array($opt['style'])) {
$this->settings['style'] = (array) $opt['style'];

View File

@ -36,7 +36,7 @@ class adminEpcList extends adminGenericList
$epc_id = [];
if (isset($_REQUEST['epc_id'])) {
foreach ($_REQUEST['epc_id'] as $v) {
$epc_id[(integer) $v] = true;
$epc_id[(int) $v] = true;
}
}

View File

@ -67,9 +67,9 @@ class epcRecords
if (!empty($params['epc_id'])) {
if (is_array($params['epc_id'])) {
array_walk($params['epc_id'], function (&$v, $k) { if ($v !== null) { $v = (integer) $v; }});
array_walk($params['epc_id'], function (&$v, $k) { if ($v !== null) { $v = (int) $v; }});
} else {
$params['epc_id'] = [(integer) $params['epc_id']];
$params['epc_id'] = [(int) $params['epc_id']];
}
$strReq .= 'AND E.epc_id ' . $this->con->in($params['epc_id']);
} elseif (isset($params['not_id']) && is_numeric($params['not_id'])) {
@ -131,7 +131,7 @@ class epcRecords
public function updRecord($id, $cur)
{
$id = (integer) $id;
$id = (int) $id;
if (empty($id)) {
throw new Exception(__('No such record ID'));
@ -157,7 +157,7 @@ class epcRecords
public function delRecord($id)
{
$id = (integer) $id;
$id = (int) $id;
if (empty($id)) {
throw new Exception(__('No such record ID'));

View File

@ -51,7 +51,7 @@ try {
$f = [
'nocase' => !empty($_POST['filter_nocase']),
'plural' => !empty($_POST['filter_plural']),
'limit' => abs((integer) $_POST['filter_limit']),
'limit' => abs((int) $_POST['filter_limit']),
'style' => (array) $_POST['filter_style'],
'notag' => (string) $_POST['filter_notag'],
'tplValues' => (array) $_POST['filter_tplValues'],
@ -219,7 +219,7 @@ __('Also use the plural') . '</label></p>
<p><label for="filter_limit">' .
__('Limit the number of replacement to:') . '</label>' .
form::number('filter_limit', ['min' => 0, 'max' => 99, 'default' => (integer) $filter->limit]) . '
form::number('filter_limit', ['min' => 0, 'max' => 99, 'default' => (int) $filter->limit]) . '
</p>
<p class="form-note">' . __('Leave it blank or set it to 0 for no limit') . '</p>

View File

@ -1,16 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_RC_PATH')) {
return;
}

View File

@ -1,16 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_RC_PATH')) {
return;
}