From d028a05e610524ee45d8e5ac6e8eb693cc1e506a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 19 Mar 2024 01:20:27 +0000 Subject: [PATCH] Updated Rector to commit b052ed9ca971f97105ac93712853ea5b897d4dd3 https://github.com/rectorphp/rector-src/commit/b052ed9ca971f97105ac93712853ea5b897d4dd3 Handle readonly class with attrs (#5736) --- rules/Php82/Rector/Class_/ReadOnlyClassRector.php | 8 ++++++++ src/Application/VersionResolver.php | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rules/Php82/Rector/Class_/ReadOnlyClassRector.php b/rules/Php82/Rector/Class_/ReadOnlyClassRector.php index 22002d50e72..397401a2603 100644 --- a/rules/Php82/Rector/Class_/ReadOnlyClassRector.php +++ b/rules/Php82/Rector/Class_/ReadOnlyClassRector.php @@ -101,10 +101,18 @@ CODE_SAMPLE if ($constructClassMethod instanceof ClassMethod) { foreach ($constructClassMethod->getParams() as $param) { $this->visibilityManipulator->removeReadonly($param); + if ($param->attrGroups !== []) { + // invoke reprint with correct newline + $param->setAttribute(AttributeKey::ORIGINAL_NODE, null); + } } } foreach ($node->getProperties() as $property) { $this->visibilityManipulator->removeReadonly($property); + if ($property->attrGroups !== []) { + // invoke reprint with correct newline + $property->setAttribute(AttributeKey::ORIGINAL_NODE, null); + } } if ($node->attrGroups !== []) { // invoke reprint with correct readonly newline diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 19b010540e6..2eb6ed60ea0 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 = 'b71d0fea8eaf051d6d55aee74c9eece0028e2165'; + public const PACKAGE_VERSION = 'b052ed9ca971f97105ac93712853ea5b897d4dd3'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-03-18 22:06:47'; + public const RELEASE_DATE = '2024-03-19 08:18:04'; /** * @var int */