diff --git a/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php b/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php index 117296ad5334..984158265bff 100644 --- a/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php +++ b/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php @@ -66,7 +66,10 @@ public function refactor(Node $node) : ?Class_ if (!$node instanceof ClassConstFetch) { return null; } - if ($this->shouldBeSkipped($class, $node)) { + if (!$this->isUsingStatic($node)) { + return null; + } + if (!$class->isFinal() && !$this->isPrivateConstant($node, $class)) { return null; } $hasChanged = \true; @@ -96,13 +99,6 @@ private function isPrivateConstant(ClassConstFetch $classConstFetch, Class_ $cla } return \false; } - private function shouldBeSkipped(Class_ $class, ClassConstFetch $classConstFetch) : bool - { - if (!$this->isUsingStatic($classConstFetch)) { - return \true; - } - return !$this->isPrivateConstant($classConstFetch, $class); - } private function getConstantName(ClassConstFetch $classConstFetch) : ?string { $constantNameIdentifier = $classConstFetch->name; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index a61e51f884f3..d1f216744617 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 = '393423fd3c87f1e915f252f8316f1616b623c320'; + public const PACKAGE_VERSION = '1ebb7aa29bfff54059d455ee6f908fa47a7416c3'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-09-08 01:36:56'; + public const RELEASE_DATE = '2024-09-08 17:51:18'; /** * @var int */