diff --git a/.github/workflows/e2e_php72.yaml b/.github/workflows/e2e_php72.yaml new file mode 100644 index 00000000000..6a373e19fe1 --- /dev/null +++ b/.github/workflows/e2e_php72.yaml @@ -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 diff --git a/e2e/reflection-union-php72/composer.json b/e2e/reflection-union-php72/composer.json new file mode 100644 index 00000000000..17cdb632c2f --- /dev/null +++ b/e2e/reflection-union-php72/composer.json @@ -0,0 +1,11 @@ +{ + "autoload": { + "psr-4": { + "App\\": "src/" + } + }, + "require": { + "php": "7.2.*", + "rector/rector": "dev-main" + } +} diff --git a/e2e/reflection-union-php72/rector.php b/e2e/reflection-union-php72/rector.php new file mode 100644 index 00000000000..6d2eb1e4fde --- /dev/null +++ b/e2e/reflection-union-php72/rector.php @@ -0,0 +1,15 @@ +paths([ + __DIR__ . '/src' + ]); + + $rectorConfig->skip([ + __DIR__ . '/vendor', + ]); +}; diff --git a/e2e/reflection-union-php72/src/foo.php b/e2e/reflection-union-php72/src/foo.php new file mode 100644 index 00000000000..844a77709f1 --- /dev/null +++ b/e2e/reflection-union-php72/src/foo.php @@ -0,0 +1,14 @@ +format('C'); + } +} diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 8aa6f4b4a5a..56cc31ad946 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -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 */ diff --git a/src/Autoloading/BootstrapFilesIncluder.php b/src/Autoloading/BootstrapFilesIncluder.php index c3304a9c42d..bb20cbeb6ce 100644 --- a/src/Autoloading/BootstrapFilesIncluder.php +++ b/src/Autoloading/BootstrapFilesIncluder.php @@ -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(); } diff --git a/vendor/autoload.php b/vendor/autoload.php index 64d18dd12f1..139a8861f7d 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit25345bae361f6ab451fed399c14a4280::getLoader(); +return ComposerAutoloaderInit3d4713e218ec589de8593ebaa48a8834::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 0742b290eab..bc971fe4402 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -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; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 5692835b14f..9091fba2532 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -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); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index 54c2f3eeb73..4e1e85a3aee 100644 --- a/vendor/scoper-autoload.php +++ b/vendor/scoper-autoload.php @@ -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')) {