Updated Rector to commit 173399b8894b7bfe802662064a8814e5560c3328

173399b889 [Performance][Testing] Use str_contains instead of regex in FixtureSplitter (#5030)
This commit is contained in:
Tomas Votruba 2023-09-17 05:03:54 +00:00
parent 6942fe920b
commit 3939ac0648
5 changed files with 21 additions and 24 deletions

View File

@ -4,35 +4,32 @@ declare (strict_types=1);
namespace Rector\Testing\Fixture;
use RectorPrefix202309\Nette\Utils\FileSystem;
use RectorPrefix202309\Nette\Utils\Strings;
/**
* @api
*/
final class FixtureSplitter
{
/**
* @api
* @var string
* @see https://regex101.com/r/zZDoyy/1
*/
public const SPLIT_LINE_REGEX = '#\\-\\-\\-\\-\\-\\r?\\n#';
public static function containsSplit(string $fixtureFileContent) : bool
{
return Strings::match($fixtureFileContent, self::SPLIT_LINE_REGEX) !== null;
return \strpos($fixtureFileContent, "-----\n") !== \false || \strpos($fixtureFileContent, "-----\r\n") !== \false;
}
/**
* @return array<string, string>
* @return array<int, string>
*/
public static function split(string $filePath) : array
{
$fixtureFileContents = FileSystem::read($filePath);
return Strings::split($fixtureFileContents, self::SPLIT_LINE_REGEX);
return self::splitFixtureFileContents($fixtureFileContents);
}
/**
* @return array<string, string>
* @return array<int, string>
*/
public static function splitFixtureFileContents(string $fixtureFileContents) : array
{
return Strings::split($fixtureFileContents, self::SPLIT_LINE_REGEX);
$posixContents = \explode("-----\n", $fixtureFileContents);
if (isset($posixContents[1])) {
return $posixContents;
}
return \explode("-----\r\n", $fixtureFileContents);
}
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '780c5afe7b1623fe23e6c198665f692275fe798e';
public const PACKAGE_VERSION = '173399b8894b7bfe802662064a8814e5560c3328';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-09-17 00:27:18';
public const RELEASE_DATE = '2023-09-17 12:00:30';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitbdae5ad336e59a52785a0110a2567f70::getLoader();
return ComposerAutoloaderInit5289bf82de56706251410b0757528dce::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitbdae5ad336e59a52785a0110a2567f70
class ComposerAutoloaderInit5289bf82de56706251410b0757528dce
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitbdae5ad336e59a52785a0110a2567f70
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitbdae5ad336e59a52785a0110a2567f70', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit5289bf82de56706251410b0757528dce', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitbdae5ad336e59a52785a0110a2567f70', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit5289bf82de56706251410b0757528dce', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit5289bf82de56706251410b0757528dce::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit5289bf82de56706251410b0757528dce::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitbdae5ad336e59a52785a0110a2567f70
class ComposerStaticInit5289bf82de56706251410b0757528dce
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -2593,9 +2593,9 @@ class ComposerStaticInitbdae5ad336e59a52785a0110a2567f70
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit5289bf82de56706251410b0757528dce::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit5289bf82de56706251410b0757528dce::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit5289bf82de56706251410b0757528dce::$classMap;
}, null, ClassLoader::class);
}