From e0ee16995ad9060a97dd6bea25d23e0cdc56fdb3 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 9 May 2022 23:27:26 -0700 Subject: [PATCH] (NFC) crmCountCharacters - Update to pass civilint --- .../plugins/modifier.crmCountCharacters.php | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/CRM/Core/Smarty/plugins/modifier.crmCountCharacters.php b/CRM/Core/Smarty/plugins/modifier.crmCountCharacters.php index 2dcfc34ff3..925acbe52b 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmCountCharacters.php +++ b/CRM/Core/Smarty/plugins/modifier.crmCountCharacters.php @@ -5,7 +5,6 @@ * @subpackage plugins */ - /** * Smarty count_characters modifier plugin * @@ -15,21 +14,19 @@ * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php * count_characters (Smarty online manual) * @author Monte Ohrt - * @param string - * @param boolean include whitespace in the character count + * @param string $string + * @param boolean $include_spaces include whitespace in the character count * @return integer */ -function smarty_modifier_crmCountCharacters($string, $include_spaces = false) -{ - if ($include_spaces) - return(strlen($string)); +function smarty_modifier_crmCountCharacters($string, $include_spaces = FALSE) { + if ($include_spaces) { + return(strlen($string)); + } - if (is_null($string)) { - return 0; - } - return preg_match_all("/[^\s]/",$string, $match); + if (is_null($string)) { + return 0; + } + return preg_match_all("/[^\s]/", $string, $match); } /* vim: set expandtab: */ - -?> -- 2.25.1