Updated Rector to commit c850701e38

f64c849ee0 [e2e] Add test for e2e Class Not Found on Parallel fb38502be2 final touch: comment 60b4112170 final touch: move psr4 e2e autoload to root composer.json to make demo correctly as expected d3240653bf correct diff, make test runner use colors for easier discovery of differences 4d8eb8af92 make copy of no-parlalel e2e e08c96b540 add misisng paths in dynamicSourceLocatorDecorator 5233f22528 [e2e] add no parallel test a741faa3a3 use explicit path c850701e38 Merge pull request #1629 from rectorphp/tv-parallel-class-not-found-2
This commit is contained in:
Tomas Votruba 2022-01-04 16:58:25 +00:00
parent c88dc245e8
commit a5ebb3a5d6
6 changed files with 37 additions and 20 deletions

View File

@ -5,8 +5,10 @@ namespace Rector\Parallel;
use RectorPrefix20220104\Clue\React\NDJson\Decoder;
use RectorPrefix20220104\Clue\React\NDJson\Encoder;
use PHPStan\Analyser\NodeScopeResolver;
use Rector\Core\Application\FileProcessor\PhpFileProcessor;
use Rector\Core\Provider\CurrentFileProvider;
use Rector\Core\StaticReflection\DynamicSourceLocatorDecorator;
use Rector\Core\ValueObject\Application\File;
use Rector\Core\ValueObject\Configuration;
use Rector\Core\ValueObject\Error\SystemError;
@ -38,14 +40,27 @@ final class WorkerRunner
* @var \Rector\Core\Application\FileProcessor\PhpFileProcessor
*/
private $phpFileProcessor;
public function __construct(\RectorPrefix20220104\Symplify\PackageBuilder\Yaml\ParametersMerger $parametersMerger, \Rector\Core\Provider\CurrentFileProvider $currentFileProvider, \Rector\Core\Application\FileProcessor\PhpFileProcessor $phpFileProcessor)
/**
* @readonly
* @var \PHPStan\Analyser\NodeScopeResolver
*/
private $nodeScopeResolver;
/**
* @readonly
* @var \Rector\Core\StaticReflection\DynamicSourceLocatorDecorator
*/
private $dynamicSourceLocatorDecorator;
public function __construct(\RectorPrefix20220104\Symplify\PackageBuilder\Yaml\ParametersMerger $parametersMerger, \Rector\Core\Provider\CurrentFileProvider $currentFileProvider, \Rector\Core\Application\FileProcessor\PhpFileProcessor $phpFileProcessor, \PHPStan\Analyser\NodeScopeResolver $nodeScopeResolver, \Rector\Core\StaticReflection\DynamicSourceLocatorDecorator $dynamicSourceLocatorDecorator)
{
$this->parametersMerger = $parametersMerger;
$this->currentFileProvider = $currentFileProvider;
$this->phpFileProcessor = $phpFileProcessor;
$this->nodeScopeResolver = $nodeScopeResolver;
$this->dynamicSourceLocatorDecorator = $dynamicSourceLocatorDecorator;
}
public function run(\RectorPrefix20220104\Clue\React\NDJson\Encoder $encoder, \RectorPrefix20220104\Clue\React\NDJson\Decoder $decoder, \Rector\Core\ValueObject\Configuration $configuration) : void
{
$this->dynamicSourceLocatorDecorator->addPaths($configuration->getPaths());
// 1. handle system error
$handleErrorCallback = static function (\Throwable $throwable) use($encoder) : void {
$systemErrors = new \Rector\Core\ValueObject\Error\SystemError($throwable->getMessage(), $throwable->getFile(), $throwable->getLine());
@ -64,6 +79,8 @@ final class WorkerRunner
$filePaths = $json[\Rector\Parallel\ValueObject\Bridge::FILES] ?? [];
$errorAndFileDiffs = [];
$systemErrors = [];
// 1. allow PHPStan to work with static reflection on provided files
$this->nodeScopeResolver->setAnalysedFiles($filePaths);
foreach ($filePaths as $filePath) {
try {
$smartFileInfo = new \Symplify\SmartFileSystem\SmartFileInfo($filePath);

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '4fbeda1e1cc0d4d3c67dac552d766031f1da3449';
public const PACKAGE_VERSION = 'c850701e384877b06d3c9c7caef9f6acf8a2f403';
/**
* @var string
*/
public const RELEASE_DATE = '2022-01-04 17:33:09';
public const RELEASE_DATE = '2022-01-04 23:48:54';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20220104\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1
class ComposerAutoloaderInitd10bd5dc878319bada61c17ffcb16d76
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitd10bd5dc878319bada61c17ffcb16d76', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitd10bd5dc878319bada61c17ffcb16d76', '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\ComposerStaticInit26c4ac663d252d4809cc73fd51c2e3c1::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitd10bd5dc878319bada61c17ffcb16d76::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,12 +42,12 @@ class ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit26c4ac663d252d4809cc73fd51c2e3c1::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitd10bd5dc878319bada61c17ffcb16d76::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire26c4ac663d252d4809cc73fd51c2e3c1($fileIdentifier, $file);
composerRequired10bd5dc878319bada61c17ffcb16d76($fileIdentifier, $file);
}
return $loader;
@ -59,7 +59,7 @@ class ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1
* @param string $file
* @return void
*/
function composerRequire26c4ac663d252d4809cc73fd51c2e3c1($fileIdentifier, $file)
function composerRequired10bd5dc878319bada61c17ffcb16d76($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 ComposerStaticInit26c4ac663d252d4809cc73fd51c2e3c1
class ComposerStaticInitd10bd5dc878319bada61c17ffcb16d76
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3850,9 +3850,9 @@ class ComposerStaticInit26c4ac663d252d4809cc73fd51c2e3c1
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit26c4ac663d252d4809cc73fd51c2e3c1::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit26c4ac663d252d4809cc73fd51c2e3c1::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit26c4ac663d252d4809cc73fd51c2e3c1::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitd10bd5dc878319bada61c17ffcb16d76::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitd10bd5dc878319bada61c17ffcb16d76::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitd10bd5dc878319bada61c17ffcb16d76::$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('RectorPrefix20220104\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1', false) && !interface_exists('ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1', false) && !trait_exists('ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1', false)) {
spl_autoload_call('RectorPrefix20220104\ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1');
if (!class_exists('ComposerAutoloaderInitd10bd5dc878319bada61c17ffcb16d76', false) && !interface_exists('ComposerAutoloaderInitd10bd5dc878319bada61c17ffcb16d76', false) && !trait_exists('ComposerAutoloaderInitd10bd5dc878319bada61c17ffcb16d76', false)) {
spl_autoload_call('RectorPrefix20220104\ComposerAutoloaderInitd10bd5dc878319bada61c17ffcb16d76');
}
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('RectorPrefix20220104\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -66,9 +66,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220104\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire26c4ac663d252d4809cc73fd51c2e3c1')) {
function composerRequire26c4ac663d252d4809cc73fd51c2e3c1() {
return \RectorPrefix20220104\composerRequire26c4ac663d252d4809cc73fd51c2e3c1(...func_get_args());
if (!function_exists('composerRequired10bd5dc878319bada61c17ffcb16d76')) {
function composerRequired10bd5dc878319bada61c17ffcb16d76() {
return \RectorPrefix20220104\composerRequired10bd5dc878319bada61c17ffcb16d76(...func_get_args());
}
}
if (!function_exists('scanPath')) {