From 1c573354d6c9e8c7894b2557fb02e9eddfa9daed Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Mon, 18 Dec 2023 01:02:52 +0900 Subject: [PATCH] Fix phpstan - Fix `Variable $tags might not be defined.` --- data/smarty_extends/function.html_checkboxes_ex.php | 1 + data/smarty_extends/function.html_radios_ex.php | 3 ++- phpstan.neon.dist | 5 ----- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/data/smarty_extends/function.html_checkboxes_ex.php b/data/smarty_extends/function.html_checkboxes_ex.php index 277416082a..d21541ed8e 100644 --- a/data/smarty_extends/function.html_checkboxes_ex.php +++ b/data/smarty_extends/function.html_checkboxes_ex.php @@ -52,6 +52,7 @@ function smarty_function_html_checkboxes_ex($params, &$smarty) $labels = true; $label_ids = true; $output = null; + $tags = []; $extra = ''; diff --git a/data/smarty_extends/function.html_radios_ex.php b/data/smarty_extends/function.html_radios_ex.php index 65a5467cfe..3575ac17bf 100644 --- a/data/smarty_extends/function.html_radios_ex.php +++ b/data/smarty_extends/function.html_radios_ex.php @@ -53,6 +53,7 @@ function smarty_function_html_radios_ex($params, &$smarty) $label_ids = true; $output = null; $extra = ''; + $tags = []; foreach ($params as $_key => $_val) { switch ($_key) { @@ -123,7 +124,7 @@ function smarty_function_html_radios_ex($params, &$smarty) if (!empty($params['assign'])) { $smarty->assign($params['assign'], $_html_result); } else { - return implode("\n",$_html_result); + return implode("\n", $_html_result); } return ''; diff --git a/phpstan.neon.dist b/phpstan.neon.dist index b8e705d855..7a586e8287 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -41,11 +41,6 @@ parameters: paths: - data/smarty_extends/function.html_radios_ex.php - data/smarty_extends/function.html_checkboxes_ex.php - - - message: "#^Undefined variable\\: \\$tags$#" - paths: - - data/smarty_extends/function.html_radios_ex.php - - data/smarty_extends/function.html_checkboxes_ex.php - message: "#^Variable \\$SJIS_widths might not be defined\\.$#" path: data/class/helper/SC_Helper_FPDI.php