mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-12 22:22:24 +00:00
12c115e6f6
5193d43b64
[NodeTypeResolver] Remove unnecessary loop SourceLocator collection on DynamicSourceLocatorProvider (#5852)
22 lines
431 B
PHP
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);
|
|
}
|
|
}
|