From bc02e1042766fd777d75f06d0a9563b0782c9d5e Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 3 Apr 2024 04:19:15 +0000 Subject: [PATCH] Updated Rector to commit b925e54b913863053e57e628ea95b2fd612e128e https://github.com/rectorphp/rector-src/commit/b925e54b913863053e57e628ea95b2fd612e128e [Performance][Php81] Early property promotion and readonly param check before changeable check on ReadOnlyPropertyRector (#5791) --- rules/Php81/Rector/Property/ReadOnlyPropertyRector.php | 6 +++--- src/Application/VersionResolver.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rules/Php81/Rector/Property/ReadOnlyPropertyRector.php b/rules/Php81/Rector/Property/ReadOnlyPropertyRector.php index c8a53f7ecc5..d6c23356540 100644 --- a/rules/Php81/Rector/Property/ReadOnlyPropertyRector.php +++ b/rules/Php81/Rector/Property/ReadOnlyPropertyRector.php @@ -180,11 +180,11 @@ CODE_SAMPLE if ($param->type === null) { return null; } - // promoted property? - if ($this->propertyManipulator->isPropertyChangeableExceptConstructor($class, $param, $scope)) { + // early check not property promotion and already readonly + if ($param->flags === 0 || $this->visibilityManipulator->isReadonly($param)) { return null; } - if ($this->visibilityManipulator->isReadonly($param)) { + if ($this->propertyManipulator->isPropertyChangeableExceptConstructor($class, $param, $scope)) { return null; } if ($this->paramAnalyzer->isParamReassign($classMethod, $param)) { diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index a443d1487ae..ff5ee1dfb5d 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 = '724899c28307e4cb1f8a7366ebb76756430da754'; + public const PACKAGE_VERSION = 'b925e54b913863053e57e628ea95b2fd612e128e'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-04-02 00:52:39'; + public const RELEASE_DATE = '2024-04-03 11:17:08'; /** * @var int */