Updated Rector to commit 1f6c7a6a20

1f6c7a6a20 [Scoper] Clean up bootstrap.php: move enum definitions to dedicated file and require in BootstrapFilesIncluder (#2248)
This commit is contained in:
Tomas Votruba 2022-05-07 08:49:37 +00:00
parent 3178565814
commit 755d463439
8 changed files with 60 additions and 53 deletions

View File

@ -39,35 +39,3 @@ spl_autoload_register(function (string $class): void {
} }
} }
}); });
if (! interface_exists('UnitEnum')) {
/**
* @since 8.1
*/
interface UnitEnum
{
/**
* @return static[]
*/
public static function cases(): array;
}
}
if (! interface_exists('BackedEnum')) {
/**
* @since 8.1
*/
interface BackedEnum extends UnitEnum {
/**
* @param int|string $value
* @return $this
*/
public static function from($value);
/**
* @param int|string $value
* @return $this|null
*/
public static function tryFrom($value);
}
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/** /**
* @var string * @var string
*/ */
public const PACKAGE_VERSION = 'b54fb770735f26d457370a95e64915d3d039b93c'; public const PACKAGE_VERSION = '1f6c7a6a20563e0b808da14688098c4c0ed592fb';
/** /**
* @var string * @var string
*/ */
public const RELEASE_DATE = '2022-05-07 07:06:17'; public const RELEASE_DATE = '2022-05-07 08:41:36';
/** /**
* @var string * @var string
*/ */

View File

@ -10,6 +10,10 @@ use Throwable;
use RectorPrefix20220507\Webmozart\Assert\Assert; use RectorPrefix20220507\Webmozart\Assert\Assert;
final class BootstrapFilesIncluder final class BootstrapFilesIncluder
{ {
/**
* @var string[]
*/
private const STUBS = ['/../../stubs-rector/PHPUnit/Framework/TestCase.php', '/../../stubs-rector/Internal/EnumInterfaces.php'];
/** /**
* @readonly * @readonly
* @var \Symplify\PackageBuilder\Parameter\ParameterProvider * @var \Symplify\PackageBuilder\Parameter\ParameterProvider
@ -39,8 +43,10 @@ final class BootstrapFilesIncluder
throw new \Rector\Core\Exception\ShouldNotHappenException($errorMessage, $throwable->getCode(), $throwable); throw new \Rector\Core\Exception\ShouldNotHappenException($errorMessage, $throwable->getCode(), $throwable);
} }
} }
if (\is_file(__DIR__ . '/../../stubs-rector/PHPUnit/Framework/TestCase.php')) { foreach (self::STUBS as $stub) {
require_once __DIR__ . '/../../stubs-rector/PHPUnit/Framework/TestCase.php'; if (\is_file(__DIR__ . $stub)) {
require_once __DIR__ . $stub;
}
} }
} }
} }

View File

@ -0,0 +1,33 @@
<?php
if (! interface_exists('UnitEnum')) {
/**
* @since 8.1
*/
interface UnitEnum
{
/**
* @return static[]
*/
public static function cases(): array;
}
}
if (! interface_exists('BackedEnum')) {
/**
* @since 8.1
*/
interface BackedEnum extends UnitEnum {
/**
* @param int|string $value
* @return $this
*/
public static function from($value);
/**
* @param int|string $value
* @return $this|null
*/
public static function tryFrom($value);
}
}

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInite334eb9647dcae786e88b5f360d96365 class ComposerAutoloaderInit575da8f25431377f12c8120ae5fdc587
{ {
private static $loader; private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInite334eb9647dcae786e88b5f360d96365
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInite334eb9647dcae786e88b5f360d96365', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit575da8f25431377f12c8120ae5fdc587', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInite334eb9647dcae786e88b5f360d96365', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit575da8f25431377f12c8120ae5fdc587', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInite334eb9647dcae786e88b5f360d96365::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit575da8f25431377f12c8120ae5fdc587::getInitializer($loader));
$loader->setClassMapAuthoritative(true); $loader->setClassMapAuthoritative(true);
$loader->register(true); $loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInite334eb9647dcae786e88b5f360d96365::$files; $includeFiles = \Composer\Autoload\ComposerStaticInit575da8f25431377f12c8120ae5fdc587::$files;
foreach ($includeFiles as $fileIdentifier => $file) { foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiree334eb9647dcae786e88b5f360d96365($fileIdentifier, $file); composerRequire575da8f25431377f12c8120ae5fdc587($fileIdentifier, $file);
} }
return $loader; return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInite334eb9647dcae786e88b5f360d96365
* @param string $file * @param string $file
* @return void * @return void
*/ */
function composerRequiree334eb9647dcae786e88b5f360d96365($fileIdentifier, $file) function composerRequire575da8f25431377f12c8120ae5fdc587($fileIdentifier, $file)
{ {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInite334eb9647dcae786e88b5f360d96365 class ComposerStaticInit575da8f25431377f12c8120ae5fdc587
{ {
public static $files = array ( public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -3883,9 +3883,9 @@ class ComposerStaticInite334eb9647dcae786e88b5f360d96365
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInite334eb9647dcae786e88b5f360d96365::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInit575da8f25431377f12c8120ae5fdc587::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInite334eb9647dcae786e88b5f360d96365::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit575da8f25431377f12c8120ae5fdc587::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInite334eb9647dcae786e88b5f360d96365::$classMap; $loader->classMap = ComposerStaticInit575da8f25431377f12c8120ae5fdc587::$classMap;
}, null, ClassLoader::class); }, 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)) { if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220507\AutoloadIncluder'); spl_autoload_call('RectorPrefix20220507\AutoloadIncluder');
} }
if (!class_exists('ComposerAutoloaderInite334eb9647dcae786e88b5f360d96365', false) && !interface_exists('ComposerAutoloaderInite334eb9647dcae786e88b5f360d96365', false) && !trait_exists('ComposerAutoloaderInite334eb9647dcae786e88b5f360d96365', false)) { if (!class_exists('ComposerAutoloaderInit575da8f25431377f12c8120ae5fdc587', false) && !interface_exists('ComposerAutoloaderInit575da8f25431377f12c8120ae5fdc587', false) && !trait_exists('ComposerAutoloaderInit575da8f25431377f12c8120ae5fdc587', false)) {
spl_autoload_call('RectorPrefix20220507\ComposerAutoloaderInite334eb9647dcae786e88b5f360d96365'); spl_autoload_call('RectorPrefix20220507\ComposerAutoloaderInit575da8f25431377f12c8120ae5fdc587');
} }
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)) { 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('RectorPrefix20220507\Helmich\TypoScriptParser\Parser\AST\Statement'); spl_autoload_call('RectorPrefix20220507\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220507\print_node(...func_get_args()); return \RectorPrefix20220507\print_node(...func_get_args());
} }
} }
if (!function_exists('composerRequiree334eb9647dcae786e88b5f360d96365')) { if (!function_exists('composerRequire575da8f25431377f12c8120ae5fdc587')) {
function composerRequiree334eb9647dcae786e88b5f360d96365() { function composerRequire575da8f25431377f12c8120ae5fdc587() {
return \RectorPrefix20220507\composerRequiree334eb9647dcae786e88b5f360d96365(...func_get_args()); return \RectorPrefix20220507\composerRequire575da8f25431377f12c8120ae5fdc587(...func_get_args());
} }
} }
if (!function_exists('scanPath')) { if (!function_exists('scanPath')) {