Skip to content

Commit

Permalink
Updated Rector to commit c850701
Browse files Browse the repository at this point in the history
rectorphp/rector-src@f64c849 [e2e] Add test for e2e Class Not Found on Parallel rectorphp/rector-src@fb38502 final touch: comment rectorphp/rector-src@60b4112 final touch: move psr4 e2e autoload to root composer.json to make demo correctly as expected rectorphp/rector-src@d324065 correct diff, make test runner use colors for easier discovery of differences rectorphp/rector-src@4d8eb8a make copy of no-parlalel e2e rectorphp/rector-src@e08c96b add misisng paths in dynamicSourceLocatorDecorator rectorphp/rector-src@5233f22 [e2e] add no parallel test rectorphp/rector-src@a741faa use explicit path rectorphp/rector-src@c850701 Merge pull request #1629 from rectorphp/tv-parallel-class-not-found-2
  • Loading branch information
TomasVotruba committed Jan 4, 2022
1 parent c88dc24 commit a5ebb3a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 20 deletions.
19 changes: 18 additions & 1 deletion packages/Parallel/WorkerRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

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;
Expand Down Expand Up @@ -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());
Expand All @@ -64,6 +79,8 @@ public function run(\RectorPrefix20220104\Clue\React\NDJson\Encoder $encoder, \R
$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);
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1::getLoader();
return ComposerAutoloaderInitd10bd5dc878319bada61c17ffcb16d76::getLoader();
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit26c4ac663d252d4809cc73fd51c2e3c1
class ComposerAutoloaderInitd10bd5dc878319bada61c17ffcb16d76
{
private static $loader;

Expand All @@ -22,15 +22,15 @@ public static function getLoader()
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) {
Expand All @@ -42,12 +42,12 @@ public static function getLoader()
$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;
Expand All @@ -59,7 +59,7 @@ public static function getLoader()
* @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;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit26c4ac663d252d4809cc73fd51c2e3c1
class ComposerStaticInitd10bd5dc878319bada61c17ffcb16d76
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
Expand Down Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions vendor/scoper-autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
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');
Expand Down Expand Up @@ -66,9 +66,9 @@ function 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')) {
Expand Down

0 comments on commit a5ebb3a

Please sign in to comment.