Splitting text into single lines in PHP

I’ve previously shared a set of functions to split text strings into single lines.
While that might use some refinement and be made paragraph-aware the one I’ve written for PHP does it all.
The result is to go from this

$input = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. ";

// split into lines of at most 60 chars and wrap each line into
// a `span.line` tag 
$output = \tad\utils\Str::splitLinesByChars($input, 60);

and “var_dumping” $output will yield

<span class="line">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</span>
<span class="line">Aenean commodo ligula eget dolor. Aenean massa. Cum sociis</span>
<span class="line">natoque penatibus et magnis dis parturient montes, nascetur</span>
<span class="line">ridiculus mus. Donec quam felis, ultricies nec, pellentesque</span>
<span class="line">eu, pretium quis, sem. Nulla consequat massa quis enim.</span>
<span class="line">Donec pede justo, fringilla vel, aliquet nec, vulputate</span>
...

The method will preserve HTML tags in the string and will not count those against the char limit so it should be safe to use on filtered content too.
Along with this method comes another, based on words, and another utility one to reduce a string to a max number of chars appending an eventual ellipsis.

public static function atMostChars($string, $maxChars = 300, $ellipsis = '&hellip;');

public static function splitLinesByWords($string, $wordsPerLine = 10, $tag = 'span', $class = 'line', $maxChars = null, $ellipsis = '&hellip;');

public static function splitLinesByChars($string, $charsPerLine = 80, $tag = 'span', $class = 'line', $maxChars = null, $ellipsis = '&hellip;');

All of this is now on GitHub.

I appreciate your input