Skip to content

Commit 5c6f396

Browse files
authored
Merge pull request #4731 from jeromegamez/always-true
Remove explicit condition that is always true
2 parents 1f67e38 + 1e5b7d0 commit 5c6f396

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

system/Helpers/text_helper.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function ascii_to_entities(string $str): string
122122
*/
123123
if (count($temp) === 1)
124124
{
125-
$out .= '&#' . array_shift($temp) . ';';
125+
$out .= '&#' . array_shift($temp) . ';';
126126
$count = 1;
127127
}
128128

@@ -140,9 +140,9 @@ function ascii_to_entities(string $str): string
140140
if (count($temp) === $count)
141141
{
142142
$number = ($count === 3) ? (($temp[0] % 16) * 4096) + (($temp[1] % 64) * 64) + ($temp[2] % 64) : (($temp[0] % 32) * 64) + ($temp[1] % 64);
143-
$out .= '&#' . $number . ';';
144-
$count = 1;
145-
$temp = [];
143+
$out .= '&#' . $number . ';';
144+
$count = 1;
145+
$temp = [];
146146
}
147147
// If this is the last iteration, just output whatever we have
148148
elseif ($i === $s)
@@ -486,7 +486,7 @@ function word_wrap(string $str, int $charlim = 76): string
486486
}
487487
// Trim the word down
488488
$temp .= mb_substr($line, 0, $charlim - 1);
489-
$line = mb_substr($line, $charlim - 1);
489+
$line = mb_substr($line, $charlim - 1);
490490
}
491491

492492
// If $temp contains data it means we had to split up an over-length
@@ -811,14 +811,14 @@ function excerpt(string $text, string $phrase = null, int $radius = 100, string
811811
$phrasePos = stripos($text, $phrase);
812812
$phraseLen = strlen($phrase);
813813
}
814-
elseif (! isset($phrase))
814+
else
815815
{
816816
$phrasePos = $radius / 2;
817817
$phraseLen = 1;
818818
}
819819

820-
$pre = explode(' ', substr($text, 0, $phrasePos)); // @phpstan-ignore-line
821-
$pos = explode(' ', substr($text, $phrasePos + $phraseLen)); // @phpstan-ignore-line
820+
$pre = explode(' ', substr($text, 0, $phrasePos));
821+
$pos = explode(' ', substr($text, $phrasePos + $phraseLen));
822822

823823
$prev = ' ';
824824
$post = ' ';

0 commit comments

Comments
 (0)