From f188888181d3ba92beb061bc51c95033a9b04077 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 9 Jun 2022 10:19:12 +0000 Subject: [PATCH] Updated Rector to commit bdf11c5968b1304f809781f9023dc7a2cf3642ad https://github.com/rectorphp/rector-src/commit/bdf11c5968b1304f809781f9023dc7a2cf3642ad [DX] Add deprecation exception about old ContainerConfigurator, to prepare for removal even in CI --- src/Application/VersionResolver.php | 4 ++-- src/DependencyInjection/RectorContainerFactory.php | 10 +++------- src/Exception/DeprecatedException.php | 9 +++++++++ vendor/autoload.php | 2 +- vendor/composer/autoload_classmap.php | 1 + vendor/composer/autoload_real.php | 14 +++++++------- vendor/composer/autoload_static.php | 9 +++++---- 7 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 src/Exception/DeprecatedException.php diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 18734937f873..216307dc94f1 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -16,11 +16,11 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = 'd1b7a49e35cd236f15ddb3010d2b91b065d094a5'; + public const PACKAGE_VERSION = 'bdf11c5968b1304f809781f9023dc7a2cf3642ad'; /** * @var string */ - public const RELEASE_DATE = '2022-06-09 12:04:36'; + public const RELEASE_DATE = '2022-06-09 12:14:06'; /** * @var int */ diff --git a/src/DependencyInjection/RectorContainerFactory.php b/src/DependencyInjection/RectorContainerFactory.php index d72ffcd1e8c1..d75647aafaed 100644 --- a/src/DependencyInjection/RectorContainerFactory.php +++ b/src/DependencyInjection/RectorContainerFactory.php @@ -7,9 +7,9 @@ use RectorPrefix20220609\Psr\Container\ContainerInterface; use Rector\Caching\Detector\ChangedFilesDetector; use Rector\Core\Autoloading\BootstrapFilesIncluder; +use Rector\Core\Exception\DeprecatedException; use Rector\Core\Kernel\RectorKernel; use Rector\Core\ValueObject\Bootstrap\BootstrapConfigs; -use RectorPrefix20220609\Symfony\Component\Console\Style\SymfonyStyle; final class RectorContainerFactory { public function createFromBootstrapConfigs(BootstrapConfigs $bootstrapConfigs) : ContainerInterface @@ -20,12 +20,8 @@ public function createFromBootstrapConfigs(BootstrapConfigs $bootstrapConfigs) : // warning about old syntax before RectorConfig $fileContents = FileSystem::read($mainConfigFile); if (\strpos($fileContents, 'ContainerConfigurator $containerConfigurator') !== \false) { - /** @var SymfonyStyle $symfonyStyle */ - $symfonyStyle = $container->get(SymfonyStyle::class); - $warningMessage = \sprintf('Your "%s" config is using old syntax with "ContainerConfigurator".%sUpgrade to "RectorConfig" that allows better autocomplete and future standard: https://getrector.org/blog/new-in-rector-012-introducing-rector-config-with-autocomplete', $mainConfigFile, \PHP_EOL); - $symfonyStyle->error($warningMessage); - // to make message noticable - \sleep(10); + $warningMessage = \sprintf('Your "%s" config uses deprecated syntax with "ContainerConfigurator".%sUpgrade to "RectorConfig": https://getrector.org/blog/new-in-rector-012-introducing-rector-config-with-autocomplete', $mainConfigFile, \PHP_EOL); + throw new DeprecatedException($warningMessage); } /** @var ChangedFilesDetector $changedFilesDetector */ $changedFilesDetector = $container->get(ChangedFilesDetector::class); diff --git a/src/Exception/DeprecatedException.php b/src/Exception/DeprecatedException.php new file mode 100644 index 000000000000..51f72997522c --- /dev/null +++ b/src/Exception/DeprecatedException.php @@ -0,0 +1,9 @@ + $baseDir . '/src/Error/ExceptionCorrector.php', 'Rector\\Core\\Exception\\Cache\\CachingException' => $baseDir . '/src/Exception/Cache/CachingException.php', 'Rector\\Core\\Exception\\Configuration\\InvalidConfigurationException' => $baseDir . '/src/Exception/Configuration/InvalidConfigurationException.php', + 'Rector\\Core\\Exception\\DeprecatedException' => $baseDir . '/src/Exception/DeprecatedException.php', 'Rector\\Core\\Exception\\NotImplementedYetException' => $baseDir . '/src/Exception/NotImplementedYetException.php', 'Rector\\Core\\Exception\\ShouldNotHappenException' => $baseDir . '/src/Exception/ShouldNotHappenException.php', 'Rector\\Core\\Exception\\VersionException' => $baseDir . '/src/Exception/VersionException.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 477e44dc2163..0ec2a9baf053 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitc3ec4e514d5835c03bacc44bd264930c +class ComposerAutoloaderInit972f9cc9d371b6943612c276c0ae560a { private static $loader; @@ -22,19 +22,19 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitc3ec4e514d5835c03bacc44bd264930c', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit972f9cc9d371b6943612c276c0ae560a', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitc3ec4e514d5835c03bacc44bd264930c', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit972f9cc9d371b6943612c276c0ae560a', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitc3ec4e514d5835c03bacc44bd264930c::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit972f9cc9d371b6943612c276c0ae560a::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInitc3ec4e514d5835c03bacc44bd264930c::$files; + $includeFiles = \Composer\Autoload\ComposerStaticInit972f9cc9d371b6943612c276c0ae560a::$files; foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirec3ec4e514d5835c03bacc44bd264930c($fileIdentifier, $file); + composerRequire972f9cc9d371b6943612c276c0ae560a($fileIdentifier, $file); } return $loader; @@ -46,7 +46,7 @@ public static function getLoader() * @param string $file * @return void */ -function composerRequirec3ec4e514d5835c03bacc44bd264930c($fileIdentifier, $file) +function composerRequire972f9cc9d371b6943612c276c0ae560a($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 926305a645db..f01b226f86ed 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitc3ec4e514d5835c03bacc44bd264930c +class ComposerStaticInit972f9cc9d371b6943612c276c0ae560a { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', @@ -1848,6 +1848,7 @@ class ComposerStaticInitc3ec4e514d5835c03bacc44bd264930c 'Rector\\Core\\Error\\ExceptionCorrector' => __DIR__ . '/../..' . '/src/Error/ExceptionCorrector.php', 'Rector\\Core\\Exception\\Cache\\CachingException' => __DIR__ . '/../..' . '/src/Exception/Cache/CachingException.php', 'Rector\\Core\\Exception\\Configuration\\InvalidConfigurationException' => __DIR__ . '/../..' . '/src/Exception/Configuration/InvalidConfigurationException.php', + 'Rector\\Core\\Exception\\DeprecatedException' => __DIR__ . '/../..' . '/src/Exception/DeprecatedException.php', 'Rector\\Core\\Exception\\NotImplementedYetException' => __DIR__ . '/../..' . '/src/Exception/NotImplementedYetException.php', 'Rector\\Core\\Exception\\ShouldNotHappenException' => __DIR__ . '/../..' . '/src/Exception/ShouldNotHappenException.php', 'Rector\\Core\\Exception\\VersionException' => __DIR__ . '/../..' . '/src/Exception/VersionException.php', @@ -3389,9 +3390,9 @@ class ComposerStaticInitc3ec4e514d5835c03bacc44bd264930c public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitc3ec4e514d5835c03bacc44bd264930c::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitc3ec4e514d5835c03bacc44bd264930c::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitc3ec4e514d5835c03bacc44bd264930c::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit972f9cc9d371b6943612c276c0ae560a::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit972f9cc9d371b6943612c276c0ae560a::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit972f9cc9d371b6943612c276c0ae560a::$classMap; }, null, ClassLoader::class); }