Updated Rector to commit 9fe44263f9

9fe44263f9 [DX] Inline PARALLEL_SYSTEM_ERROR_COUNT_LIMIT option to keep user scope outside internal system (#1818)
This commit is contained in:
Tomas Votruba 2022-02-15 22:07:17 +00:00
parent faf3d546ae
commit 7d7b002e7c
8 changed files with 26 additions and 28 deletions

View File

@ -19,7 +19,6 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$parameters->set(\Rector\Core\Configuration\Option::PARALLEL_MAX_NUMBER_OF_PROCESSES, 16);
$parameters->set(\Rector\Core\Configuration\Option::PARALLEL_JOB_SIZE, 20);
$parameters->set(\Rector\Core\Configuration\Option::PARALLEL_TIMEOUT_IN_SECONDS, 120);
$parameters->set(\Rector\Core\Configuration\Option::PARALLEL_SYSTEM_ERROR_COUNT_LIMIT, 20);
// FQN class importing
$parameters->set(\Rector\Core\Configuration\Option::AUTO_IMPORT_NAMES, \false);
$parameters->set(\Rector\Core\Configuration\Option::IMPORT_SHORT_CLASSES, \true);

View File

@ -37,6 +37,10 @@ use Throwable;
*/
final class ParallelFileProcessor
{
/**
* @var int
*/
private const SYSTEM_ERROR_LIMIT = 50;
/**
* @var \Symplify\EasyParallel\ValueObject\ProcessPool|null
*/
@ -104,7 +108,6 @@ final class ParallelFileProcessor
$this->processPool->quitAll();
};
$timeoutInSeconds = $this->parameterProvider->provideIntParameter(\Rector\Core\Configuration\Option::PARALLEL_TIMEOUT_IN_SECONDS);
$systemErrorCountLimit = $this->parameterProvider->provideIntParameter(\Rector\Core\Configuration\Option::PARALLEL_SYSTEM_ERROR_COUNT_LIMIT);
for ($i = 0; $i < $numberOfProcesses; ++$i) {
// nothing else to process, stop now
if ($jobs === []) {
@ -115,7 +118,7 @@ final class ParallelFileProcessor
$parallelProcess = new \RectorPrefix20220215\Symplify\EasyParallel\ValueObject\ParallelProcess($workerCommandLine, $streamSelectLoop, $timeoutInSeconds);
$parallelProcess->start(
// 1. callable on data
function (array $json) use($parallelProcess, &$systemErrors, &$fileDiffs, &$jobs, $postFileCallback, &$systemErrorsCount, &$reachedInternalErrorsCountLimit, $processIdentifier, $systemErrorCountLimit) : void {
function (array $json) use($parallelProcess, &$systemErrors, &$fileDiffs, &$jobs, $postFileCallback, &$systemErrorsCount, &$reachedInternalErrorsCountLimit, $processIdentifier) : void {
// decode arrays to objects
foreach ($json[\Rector\Parallel\ValueObject\Bridge::SYSTEM_ERRORS] as $jsonError) {
if (\is_string($jsonError)) {
@ -129,7 +132,7 @@ final class ParallelFileProcessor
}
$postFileCallback($json[\Rector\Parallel\ValueObject\Bridge::FILES_COUNT]);
$systemErrorsCount += $json[\Rector\Parallel\ValueObject\Bridge::SYSTEM_ERRORS_COUNT];
if ($systemErrorsCount >= $systemErrorCountLimit) {
if ($systemErrorsCount >= self::SYSTEM_ERROR_LIMIT) {
$reachedInternalErrorsCountLimit = \true;
$this->processPool->quitAll();
}
@ -158,7 +161,7 @@ final class ParallelFileProcessor
}
$streamSelectLoop->run();
if ($reachedSystemErrorsCountLimit) {
$systemErrors[] = new \Rector\Core\ValueObject\Error\SystemError(\sprintf('Reached system errors count limit of %d, exiting...', $systemErrorCountLimit));
$systemErrors[] = new \Rector\Core\ValueObject\Error\SystemError(\sprintf('Reached system errors count limit of %d, exiting...', self::SYSTEM_ERROR_LIMIT));
}
return [\Rector\Parallel\ValueObject\Bridge::FILE_DIFFS => $fileDiffs, \Rector\Parallel\ValueObject\Bridge::SYSTEM_ERRORS => $systemErrors, \Rector\Parallel\ValueObject\Bridge::SYSTEM_ERRORS_COUNT => \count($systemErrors)];
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'd670c9351974baf819647e13012c0d685748ae01';
public const PACKAGE_VERSION = '9fe44263f906009ab96cae86c89a3ace6a941b41';
/**
* @var string
*/
public const RELEASE_DATE = '2022-02-15 21:00:07';
public const RELEASE_DATE = '2022-02-15 22:58:51';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20220215\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

View File

@ -162,10 +162,6 @@ final class Option
* @var string
*/
public const PARALLEL_TIMEOUT_IN_SECONDS = 'parallel-timeout-in-seconds';
/**
* @var string
*/
public const PARALLEL_SYSTEM_ERROR_COUNT_LIMIT = 'parallel-system-error-count-limit';
/**
* @var string
*/

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f::getLoader();
return ComposerAutoloaderInit94e603ff37b4f42de2dd41e489cddf66::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f
class ComposerAutoloaderInit94e603ff37b4f42de2dd41e489cddf66
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit94e603ff37b4f42de2dd41e489cddf66', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit94e603ff37b4f42de2dd41e489cddf66', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit9777dce46c36b08b10d3e48396a1895f::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit94e603ff37b4f42de2dd41e489cddf66::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,12 +42,12 @@ class ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit9777dce46c36b08b10d3e48396a1895f::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit94e603ff37b4f42de2dd41e489cddf66::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire9777dce46c36b08b10d3e48396a1895f($fileIdentifier, $file);
composerRequire94e603ff37b4f42de2dd41e489cddf66($fileIdentifier, $file);
}
return $loader;
@ -59,7 +59,7 @@ class ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f
* @param string $file
* @return void
*/
function composerRequire9777dce46c36b08b10d3e48396a1895f($fileIdentifier, $file)
function composerRequire94e603ff37b4f42de2dd41e489cddf66($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 ComposerStaticInit9777dce46c36b08b10d3e48396a1895f
class ComposerStaticInit94e603ff37b4f42de2dd41e489cddf66
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3881,9 +3881,9 @@ class ComposerStaticInit9777dce46c36b08b10d3e48396a1895f
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit9777dce46c36b08b10d3e48396a1895f::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit9777dce46c36b08b10d3e48396a1895f::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit9777dce46c36b08b10d3e48396a1895f::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit94e603ff37b4f42de2dd41e489cddf66::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit94e603ff37b4f42de2dd41e489cddf66::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit94e603ff37b4f42de2dd41e489cddf66::$classMap;
}, null, ClassLoader::class);
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220215\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f', false) && !interface_exists('ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f', false) && !trait_exists('ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f', false)) {
spl_autoload_call('RectorPrefix20220215\ComposerAutoloaderInit9777dce46c36b08b10d3e48396a1895f');
if (!class_exists('ComposerAutoloaderInit94e603ff37b4f42de2dd41e489cddf66', false) && !interface_exists('ComposerAutoloaderInit94e603ff37b4f42de2dd41e489cddf66', false) && !trait_exists('ComposerAutoloaderInit94e603ff37b4f42de2dd41e489cddf66', false)) {
spl_autoload_call('RectorPrefix20220215\ComposerAutoloaderInit94e603ff37b4f42de2dd41e489cddf66');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220215\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220215\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire9777dce46c36b08b10d3e48396a1895f')) {
function composerRequire9777dce46c36b08b10d3e48396a1895f() {
return \RectorPrefix20220215\composerRequire9777dce46c36b08b10d3e48396a1895f(...func_get_args());
if (!function_exists('composerRequire94e603ff37b4f42de2dd41e489cddf66')) {
function composerRequire94e603ff37b4f42de2dd41e489cddf66() {
return \RectorPrefix20220215\composerRequire94e603ff37b4f42de2dd41e489cddf66(...func_get_args());
}
}
if (!function_exists('scanPath')) {