Updated Rector to commit 5640d513d2434ac4cec2d3c946d44a40a7a468d6

5640d513d2 [Core] Fix bootstrap stubs load on PHP 7.2 when vendor/ excluded via skip() (#2394)
This commit is contained in:
Tomas Votruba 2022-05-31 12:44:36 +00:00
parent f219c9f429
commit f04a3bc21f
10 changed files with 98 additions and 28 deletions

32
.github/workflows/e2e_php72.yaml vendored Normal file
View File

@ -0,0 +1,32 @@
name: End to End tests on PHP 7.2
on:
pull_request: null
push:
branches:
- main
jobs:
end_to_end_on_php72:
runs-on: ubuntu-latest
name: End to end test - PHP 7.2 with load ReflectionUnionType stub
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: "7.2"
coverage: none
# wait for deploy to packagist
- run: sleep 70
-
run: composer install --ansi
working-directory: e2e/reflection-union-php72
-
run: vendor/bin/rector process --ansi
working-directory: e2e/reflection-union-php72

View File

@ -0,0 +1,11 @@
{
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"require": {
"php": "7.2.*",
"rector/rector": "dev-main"
}
}

View File

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src'
]);
$rectorConfig->skip([
__DIR__ . '/vendor',
]);
};

View File

@ -0,0 +1,14 @@
<?php
namespace App;
class Foo {
/**
* @param \DateTime|\DateTimeImmutable $date
* @return string
*/
public function bar($date) {
return $date->format('C');
}
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'cd405e6512348d27c2494e9164652b405542e1c8';
public const PACKAGE_VERSION = '5640d513d2434ac4cec2d3c946d44a40a7a468d6';
/**
* @var string
*/
public const RELEASE_DATE = '2022-05-31 14:37:13';
public const RELEASE_DATE = '2022-05-31 14:38:05';
/**
* @var int
*/

View File

@ -5,7 +5,9 @@ namespace Rector\Core\Autoloading;
use Rector\Core\Configuration\Option;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\FileSystem\FilesFinder;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use SplFileInfo;
use RectorPrefix20220531\Symplify\PackageBuilder\Parameter\ParameterProvider;
use Throwable;
use RectorPrefix20220531\Webmozart\Assert\Assert;
@ -16,15 +18,9 @@ final class BootstrapFilesIncluder
* @var \Symplify\PackageBuilder\Parameter\ParameterProvider
*/
private $parameterProvider;
/**
* @readonly
* @var \Rector\Core\FileSystem\FilesFinder
*/
private $filesFinder;
public function __construct(\RectorPrefix20220531\Symplify\PackageBuilder\Parameter\ParameterProvider $parameterProvider, \Rector\Core\FileSystem\FilesFinder $filesFinder)
public function __construct(\RectorPrefix20220531\Symplify\PackageBuilder\Parameter\ParameterProvider $parameterProvider)
{
$this->parameterProvider = $parameterProvider;
$this->filesFinder = $filesFinder;
}
/**
* Inspired by
@ -50,7 +46,9 @@ final class BootstrapFilesIncluder
if ($stubsRectorDirectory === \false) {
return;
}
$stubs = $this->filesFinder->findInDirectoriesAndFiles([$stubsRectorDirectory], ['php']);
$dir = new \RecursiveDirectoryIterator($stubsRectorDirectory, \RecursiveDirectoryIterator::SKIP_DOTS);
/** @var SplFileInfo[] $stubs */
$stubs = new \RecursiveIteratorIterator($dir);
foreach ($stubs as $stub) {
require_once $stub->getRealPath();
}

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280
class ComposerAutoloaderInit3d4713e218ec589de8593ebaa48a8834
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit3d4713e218ec589de8593ebaa48a8834', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit3d4713e218ec589de8593ebaa48a8834', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit25345bae361f6ab451fed399c14a4280::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit3d4713e218ec589de8593ebaa48a8834::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit25345bae361f6ab451fed399c14a4280::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit3d4713e218ec589de8593ebaa48a8834::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire25345bae361f6ab451fed399c14a4280($fileIdentifier, $file);
composerRequire3d4713e218ec589de8593ebaa48a8834($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280
* @param string $file
* @return void
*/
function composerRequire25345bae361f6ab451fed399c14a4280($fileIdentifier, $file)
function composerRequire3d4713e218ec589de8593ebaa48a8834($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 ComposerStaticInit25345bae361f6ab451fed399c14a4280
class ComposerStaticInit3d4713e218ec589de8593ebaa48a8834
{
public static $files = array (
'23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php',
@ -3762,9 +3762,9 @@ class ComposerStaticInit25345bae361f6ab451fed399c14a4280
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit25345bae361f6ab451fed399c14a4280::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit25345bae361f6ab451fed399c14a4280::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit25345bae361f6ab451fed399c14a4280::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit3d4713e218ec589de8593ebaa48a8834::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit3d4713e218ec589de8593ebaa48a8834::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit3d4713e218ec589de8593ebaa48a8834::$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('RectorPrefix20220531\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280', false) && !interface_exists('ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280', false) && !trait_exists('ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280', false)) {
spl_autoload_call('RectorPrefix20220531\ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280');
if (!class_exists('ComposerAutoloaderInit3d4713e218ec589de8593ebaa48a8834', false) && !interface_exists('ComposerAutoloaderInit3d4713e218ec589de8593ebaa48a8834', false) && !trait_exists('ComposerAutoloaderInit3d4713e218ec589de8593ebaa48a8834', false)) {
spl_autoload_call('RectorPrefix20220531\ComposerAutoloaderInit3d4713e218ec589de8593ebaa48a8834');
}
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('RectorPrefix20220531\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -56,9 +56,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220531\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire25345bae361f6ab451fed399c14a4280')) {
function composerRequire25345bae361f6ab451fed399c14a4280() {
return \RectorPrefix20220531\composerRequire25345bae361f6ab451fed399c14a4280(...func_get_args());
if (!function_exists('composerRequire3d4713e218ec589de8593ebaa48a8834')) {
function composerRequire3d4713e218ec589de8593ebaa48a8834() {
return \RectorPrefix20220531\composerRequire3d4713e218ec589de8593ebaa48a8834(...func_get_args());
}
}
if (!function_exists('scanPath')) {