Skip to content

Commit d40b3e7

Browse files
committed
refactor: reduce_multiples()
To suppress PHPStan false positive error.
1 parent 223f286 commit d40b3e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

system/Helpers/text_helper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,8 @@ function reduce_double_slashes(string $str): string
526526
*/
527527
function reduce_multiples(string $str, string $character = ',', bool $trim = false): string
528528
{
529-
$str = preg_replace('#' . preg_quote($character, '#') . '{2,}#', $character, $str);
529+
$pattern = '#' . preg_quote($character, '#') . '{2,}#';
530+
$str = preg_replace($pattern, $character, $str);
530531

531532
return ($trim) ? trim($str, $character) : $str;
532533
}

0 commit comments

Comments
 (0)