Skip to content

Commit

Permalink
Merge pull request #303 from bowphp/fix/str
Browse files Browse the repository at this point in the history
fix: stop execute of words
  • Loading branch information
papac authored Dec 18, 2024
2 parents 9cce14e + e1abfc1 commit 414ab4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ public static function words(string $words, int $len): string
$sentence = '';

for ($i = 0; $i < $len; $i++) {
if (!isset($wordParts[$i])) {
break;
}

$sentence .= ' ' . $wordParts[$i];
}

Expand Down

0 comments on commit 414ab4b

Please sign in to comment.