rector/src/Util/NewLineSplitter.php
Tomas Votruba dc98feb11d Updated Rector to commit 290926cc8b93331dd715d7ea061847dafbc1821a
290926cc8b  [Util] Make consistent new line splitter to Util  (#5651)
2024-02-21 15:30:52 +00:00

22 lines
431 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Util;
use RectorPrefix202402\Nette\Utils\Strings;
final class NewLineSplitter
{
/**
* @var string
* @see https://regex101.com/r/qduj2O/4
*/
private const NEWLINES_REGEX = "#\r?\n#";
/**
* @return string[]
*/
public static function split(string $content) : array
{
return Strings::split($content, self::NEWLINES_REGEX);
}
}