rector/src/Util/NewLineSplitter.php
Tomas Votruba 12c115e6f6 Updated Rector to commit 5193d43b644f9d059d9964ebcc6820181a7bca18
5193d43b64 [NodeTypeResolver] Remove unnecessary loop SourceLocator collection on DynamicSourceLocatorProvider (#5852)
2024-05-02 02:21:56 +00:00

22 lines
431 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Util;
use RectorPrefix202405\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);
}
}