From daa84a6ddffbd020260af767363d3e262c5b2798 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 5 Mar 2024 11:36:28 +0000 Subject: [PATCH] Updated Rector to commit 10c7bc6a4114dddde311e49efcd9c441ea92babc https://github.com/rectorphp/rector-src/commit/10c7bc6a4114dddde311e49efcd9c441ea92babc [Performance][Php81] Ensure check readonly on param only on __construct() method (#5693) --- rules/Php81/Rector/Property/ReadOnlyPropertyRector.php | 3 ++- src/Application/VersionResolver.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rules/Php81/Rector/Property/ReadOnlyPropertyRector.php b/rules/Php81/Rector/Property/ReadOnlyPropertyRector.php index 855f2cc6c0c..c8a53f7ecc5 100644 --- a/rules/Php81/Rector/Property/ReadOnlyPropertyRector.php +++ b/rules/Php81/Rector/Property/ReadOnlyPropertyRector.php @@ -116,7 +116,8 @@ CODE_SAMPLE return null; } $hasChanged = \false; - foreach ($node->getMethods() as $classMethod) { + $classMethod = $node->getMethod(MethodName::CONSTRUCT); + if ($classMethod instanceof ClassMethod) { foreach ($classMethod->params as $param) { $justChanged = $this->refactorParam($node, $classMethod, $param, $scope); // different variable to ensure $hasRemoved not replaced diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 2e18de56cc4..f54464e5ff0 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 = 'e29b97e4b5d6dd5a0c5ee442067cb52f7dbb7f25'; + public const PACKAGE_VERSION = '10c7bc6a4114dddde311e49efcd9c441ea92babc'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-03-05 18:26:34'; + public const RELEASE_DATE = '2024-03-05 18:34:08'; /** * @var int */