From 855f7c25035a2c42797db6353fa3037b278a906d Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 23 Jul 2023 09:42:10 +0000 Subject: [PATCH] Updated Rector to commit 50a5bb4057387d3053c5ea1ecf22286ea04dff36 https://github.com/rectorphp/rector-src/commit/50a5bb4057387d3053c5ea1ecf22286ea04dff36 [BUGFIX] Ensure proper reprint with attributes for finalized classes (#4585) --- .../Class_/FinalizeClassesWithoutChildrenRector.php | 5 +++++ src/Application/VersionResolver.php | 4 ++-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/rules/Privatization/Rector/Class_/FinalizeClassesWithoutChildrenRector.php b/rules/Privatization/Rector/Class_/FinalizeClassesWithoutChildrenRector.php index 3bbfad8fbf27..55137afe4441 100644 --- a/rules/Privatization/Rector/Class_/FinalizeClassesWithoutChildrenRector.php +++ b/rules/Privatization/Rector/Class_/FinalizeClassesWithoutChildrenRector.php @@ -11,6 +11,7 @@ use Rector\Core\Rector\AbstractRector; use Rector\Core\Reflection\ReflectionResolver; use Rector\FamilyTree\Reflection\FamilyRelationsAnalyzer; +use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\Privatization\NodeManipulator\VisibilityManipulator; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -111,6 +112,10 @@ public function refactor(Node $node) : ?Node if ($childrenClassReflections !== []) { return null; } + if ($node->attrGroups !== []) { + // improve reprint with correct newline + $node->setAttribute(AttributeKey::ORIGINAL_NODE, null); + } $this->visibilityManipulator->makeFinal($node); return $node; } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 105b99b66224..c11bb363841b 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'a7cd7eda65894aea11ca012cac8ea4a29fb0a051'; + public const PACKAGE_VERSION = '50a5bb4057387d3053c5ea1ecf22286ea04dff36'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-07-22 14:06:03'; + public const RELEASE_DATE = '2023-07-23 09:38:14'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index 2ea9afd4a4eb..4b308ebfe2ed 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit6f2dabd27ad2dcf04ce3efd4f1c5e824::getLoader(); +return ComposerAutoloaderInit077b26424264f408ebee9607753e1c37::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index e903e54a1a51..1e1490ca0393 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit6f2dabd27ad2dcf04ce3efd4f1c5e824 +class ComposerAutoloaderInit077b26424264f408ebee9607753e1c37 { private static $loader; @@ -22,17 +22,17 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit6f2dabd27ad2dcf04ce3efd4f1c5e824', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit077b26424264f408ebee9607753e1c37', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit6f2dabd27ad2dcf04ce3efd4f1c5e824', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit077b26424264f408ebee9607753e1c37', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit6f2dabd27ad2dcf04ce3efd4f1c5e824::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit077b26424264f408ebee9607753e1c37::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit6f2dabd27ad2dcf04ce3efd4f1c5e824::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit077b26424264f408ebee9607753e1c37::$files; $requireFile = \Closure::bind(static function ($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 fdd4ee02e6bf..702b6b7c8e9e 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit6f2dabd27ad2dcf04ce3efd4f1c5e824 +class ComposerStaticInit077b26424264f408ebee9607753e1c37 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3020,9 +3020,9 @@ class ComposerStaticInit6f2dabd27ad2dcf04ce3efd4f1c5e824 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit6f2dabd27ad2dcf04ce3efd4f1c5e824::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit6f2dabd27ad2dcf04ce3efd4f1c5e824::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit6f2dabd27ad2dcf04ce3efd4f1c5e824::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit077b26424264f408ebee9607753e1c37::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit077b26424264f408ebee9607753e1c37::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit077b26424264f408ebee9607753e1c37::$classMap; }, null, ClassLoader::class); }