From be5c5524fbc945545831693ef5299723052fb232 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 8 Jun 2023 16:25:40 +0200 Subject: [PATCH 1/3] remove deprecated rule interface, as unused --- src/Contract/Rector/DeprecatedRectorInterface.php | 12 ------------ utils/Command/MissingInSetCommand.php | 4 +--- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 src/Contract/Rector/DeprecatedRectorInterface.php diff --git a/src/Contract/Rector/DeprecatedRectorInterface.php b/src/Contract/Rector/DeprecatedRectorInterface.php deleted file mode 100644 index dcc60730d06..00000000000 --- a/src/Contract/Rector/DeprecatedRectorInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -symfonyStyle->success('All sets contains the rules from their category'); + $this->symfonyStyle->success(sprintf('All %d sets contains the rules from their category', count(self::RULES_DIRECTORY_TO_SET_CONFIG))); return self::SUCCESS; } From f88399488ea11521ed7e7052139346d169cb7c71 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 8 Jun 2023 16:36:05 +0200 Subject: [PATCH 2/3] Make ConvertStaticPrivateConstantToSelfRector work for non-final class consts too --- ...tantToSelfRectorForNonFinalClassesTest.php | 28 ---- ...lf.php.inc => change-in-non-final.php.inc} | 8 +- ...nal-annotation-will-not-be-changed.php.inc | 16 --- ...on-final-class-will-not-be-changed.php.inc | 13 -- ...from-other-classes-are-not-changed.php.inc | 12 -- ...tant-with-self-will-not-be-changed.php.inc | 13 -- .../private-constant-with-static.php.inc | 31 ++++ .../replace-in-private-methods.php.inc | 4 +- .../Fixture/skip-already-self.php.inc | 13 ++ .../skip-constant-from-other-class.php.inc | 11 ++ ....php.inc => skip-other-visibility.php.inc} | 7 +- ...used-in-child-classes-as-protected.php.inc | 18 --- ...if-used-in-child-classes-as-public.php.inc | 18 --- ...place-if-not-used-in-child-classes.php.inc | 33 ----- .../config/config_non_final_classes.php | 16 --- ...nvertStaticPrivateConstantToSelfRector.php | 132 ++++++------------ utils/Command/MissingInSetCommand.php | 4 +- 17 files changed, 109 insertions(+), 268 deletions(-) delete mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/ConvertStaticPrivateConstantToSelfRectorForNonFinalClassesTest.php rename rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/{private-constant-with-static-should-use-self.php.inc => change-in-non-final.php.inc} (55%) delete mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/const-in-class-with-final-annotation-will-not-be-changed.php.inc delete mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/const-in-non-final-class-will-not-be-changed.php.inc delete mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/constants-from-other-classes-are-not-changed.php.inc delete mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-self-will-not-be-changed.php.inc create mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-static.php.inc create mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/skip-already-self.php.inc create mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/skip-constant-from-other-class.php.inc rename rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/{other-visibilities-are-not-changed.php.inc => skip-other-visibility.php.inc} (58%) delete mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/do-not-replace-if-used-in-child-classes-as-protected.php.inc delete mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/do-not-replace-if-used-in-child-classes-as-public.php.inc delete mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/replace-if-not-used-in-child-classes.php.inc delete mode 100644 rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/config/config_non_final_classes.php diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/ConvertStaticPrivateConstantToSelfRectorForNonFinalClassesTest.php b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/ConvertStaticPrivateConstantToSelfRectorForNonFinalClassesTest.php deleted file mode 100644 index 840d752683b..00000000000 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/ConvertStaticPrivateConstantToSelfRectorForNonFinalClassesTest.php +++ /dev/null @@ -1,28 +0,0 @@ -doTestFile($filePath); - } - - public static function provideData(): Iterator - { - return self::yieldFilesFromDirectory(__DIR__ . '/FixtureEnableForNonFinalClasses'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/config_non_final_classes.php'; - } -} diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-static-should-use-self.php.inc b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/change-in-non-final.php.inc similarity index 55% rename from rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-static-should-use-self.php.inc rename to rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/change-in-non-final.php.inc index b42f3412c4f..594bb7ca6a3 100644 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-static-should-use-self.php.inc +++ b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/change-in-non-final.php.inc @@ -1,8 +1,8 @@ diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/const-in-non-final-class-will-not-be-changed.php.inc b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/const-in-non-final-class-will-not-be-changed.php.inc deleted file mode 100644 index 4ec84989c71..00000000000 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/const-in-non-final-class-will-not-be-changed.php.inc +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/constants-from-other-classes-are-not-changed.php.inc b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/constants-from-other-classes-are-not-changed.php.inc deleted file mode 100644 index b89635e4d3d..00000000000 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/constants-from-other-classes-are-not-changed.php.inc +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-self-will-not-be-changed.php.inc b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-self-will-not-be-changed.php.inc deleted file mode 100644 index 3350a7b071c..00000000000 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-self-will-not-be-changed.php.inc +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-static.php.inc b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-static.php.inc new file mode 100644 index 00000000000..3953e4516f0 --- /dev/null +++ b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/private-constant-with-static.php.inc @@ -0,0 +1,31 @@ + +----- + diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/replace-in-private-methods.php.inc b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/replace-in-private-methods.php.inc index f7b2636e8ce..db1456f9689 100644 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/replace-in-private-methods.php.inc +++ b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/Fixture/replace-in-private-methods.php.inc @@ -1,6 +1,6 @@ diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/do-not-replace-if-used-in-child-classes-as-protected.php.inc b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/do-not-replace-if-used-in-child-classes-as-protected.php.inc deleted file mode 100644 index a254d511f01..00000000000 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/do-not-replace-if-used-in-child-classes-as-protected.php.inc +++ /dev/null @@ -1,18 +0,0 @@ - diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/do-not-replace-if-used-in-child-classes-as-public.php.inc b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/do-not-replace-if-used-in-child-classes-as-public.php.inc deleted file mode 100644 index 948655afbe8..00000000000 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/do-not-replace-if-used-in-child-classes-as-public.php.inc +++ /dev/null @@ -1,18 +0,0 @@ - diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/replace-if-not-used-in-child-classes.php.inc b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/replace-if-not-used-in-child-classes.php.inc deleted file mode 100644 index 68075fb21f3..00000000000 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/FixtureEnableForNonFinalClasses/replace-if-not-used-in-child-classes.php.inc +++ /dev/null @@ -1,33 +0,0 @@ - ------ - diff --git a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/config/config_non_final_classes.php b/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/config/config_non_final_classes.php deleted file mode 100644 index 62d719faef2..00000000000 --- a/rules-tests/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector/config/config_non_final_classes.php +++ /dev/null @@ -1,16 +0,0 @@ -ruleWithConfiguration( - ConvertStaticPrivateConstantToSelfRector::class, - [ - ConvertStaticPrivateConstantToSelfRector::ENABLE_FOR_NON_FINAL_CLASSES => true, - ] - ); -}; diff --git a/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php b/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php index b99dbba93c6..743e26c5955 100644 --- a/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php +++ b/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php @@ -10,44 +10,29 @@ use PhpParser\Node\Name; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; -use PHPStan\Reflection\ClassReflection; -use Rector\Core\Contract\Rector\AllowEmptyConfigurableRectorInterface; use Rector\Core\Rector\AbstractRector; -use Rector\Core\Reflection\ReflectionResolver; -use Rector\FamilyTree\Reflection\FamilyRelationsAnalyzer; -use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample; +use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Tests\CodeQuality\Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\ConvertStaticPrivateConstantToSelfRectorTest + * * @see https://3v4l.org/8Y0ba * @see https://phpstan.org/r/11d4c850-1a40-4fae-b665-291f96104d11 */ -final class ConvertStaticPrivateConstantToSelfRector extends AbstractRector implements AllowEmptyConfigurableRectorInterface +final class ConvertStaticPrivateConstantToSelfRector extends AbstractRector { - /** - * @api - * @var string - */ - public const ENABLE_FOR_NON_FINAL_CLASSES = 'enable_for_non_final_classes'; - - private bool $enableForNonFinalClasses = false; - - public function __construct( - private readonly FamilyRelationsAnalyzer $familyRelationsAnalyzer, - private readonly ReflectionResolver $reflectionResolver, - ) { - } - public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( 'Replaces static::* access to private constants with self::*', [ - new ConfiguredCodeSample( + new CodeSample( <<<'CODE_SAMPLE' -final class Foo { +final class Foo +{ private const BAR = 'bar'; + public function run() { $bar = static::BAR; @@ -56,61 +41,66 @@ public function run() CODE_SAMPLE , <<<'CODE_SAMPLE' -final class Foo { +final class Foo +{ private const BAR = 'bar'; + public function run() { $bar = self::BAR; } } CODE_SAMPLE - , - [ - self::ENABLE_FOR_NON_FINAL_CLASSES => false, - ], ), ], ); } + /** + * @return array> + */ public function getNodeTypes(): array { - return [ClassConstFetch::class]; - } - - public function configure(array $configuration): void - { - $this->enableForNonFinalClasses = $configuration[self::ENABLE_FOR_NON_FINAL_CLASSES] ?? (bool) current( - $configuration - ); + return [Class_::class]; } /** - * @param ClassConstFetch $node + * @param Class_ $node */ - public function refactor(Node $node): ?ClassConstFetch + public function refactor(Node $node): ?Class_ { - $class = $this->betterNodeFinder->findParentType($node, Class_::class); - if (! $class instanceof Class_) { + if ($node->getConstants() === []) { return null; } - if ($this->shouldBeSkipped($class, $node)) { - return null; - } + $class = $node; + $hasChanged = false; + + $this->traverseNodesWithCallable($class, function (Node $node) use ($class, &$hasChanged): ?Node { + if (! $node instanceof ClassConstFetch) { + return null; + } - $node->class = new Name('self'); + if ($this->shouldBeSkipped($class, $node)) { + return null; + } + + $hasChanged = true; - return $node; + $node->class = new Name('self'); + return $node; + }); + + if ($hasChanged) { + return $node; + } + + return null; } private function isUsingStatic(ClassConstFetch $classConstFetch): bool { - if (! $classConstFetch->class instanceof Name) { - return false; - } - - return $classConstFetch->class->toString() === 'static'; + return $this->isName($classConstFetch->class, 'static'); } private function isPrivateConstant(ClassConstFetch $classConstFetch, Class_ $class): bool @@ -131,13 +121,8 @@ private function isPrivateConstant(ClassConstFetch $classConstFetch, Class_ $cla return false; } - private function isUsedInPrivateMethod(ClassConstFetch $classConstFetch): bool + private function isUsedInPrivateMethod(ClassMethod $classMethod): bool { - $classMethod = $this->betterNodeFinder->findParentType($classConstFetch, ClassMethod::class); - if (! $classMethod instanceof ClassMethod) { - return false; - } - return $classMethod->flags === Class_::MODIFIER_PRIVATE; } @@ -147,42 +132,7 @@ private function shouldBeSkipped(Class_ $class, ClassConstFetch $classConstFetch return true; } - if (! $this->isPrivateConstant($classConstFetch, $class)) { - return true; - } - - if ($this->isUsedInPrivateMethod($classConstFetch)) { - return false; - } - - if ($this->enableForNonFinalClasses) { - return $this->isOverwrittenInChildClass($classConstFetch); - } - - return ! $class->isFinal(); - } - - private function isOverwrittenInChildClass(ClassConstFetch $classConstFetch): bool - { - $constantName = $this->getConstantName($classConstFetch); - if ($constantName === null) { - return false; - } - - $classReflection = $this->reflectionResolver->resolveClassReflection($classConstFetch); - if (! $classReflection instanceof ClassReflection) { - return false; - } - - $childrenClassReflections = $this->familyRelationsAnalyzer->getChildrenOfClassReflection($classReflection); - - foreach ($childrenClassReflections as $childClassReflection) { - if ($childClassReflection->hasConstant($constantName)) { - return true; - } - } - - return false; + return ! $this->isPrivateConstant($classConstFetch, $class); } private function getConstantName(ClassConstFetch $classConstFetch): ?string diff --git a/utils/Command/MissingInSetCommand.php b/utils/Command/MissingInSetCommand.php index 7ac9d1b74ff..c8acad69c80 100644 --- a/utils/Command/MissingInSetCommand.php +++ b/utils/Command/MissingInSetCommand.php @@ -108,7 +108,9 @@ static function (string $rectorClass): bool { return self::FAILURE; } - $this->symfonyStyle->success(sprintf('All %d sets contains the rules from their category', count(self::RULES_DIRECTORY_TO_SET_CONFIG))); + $this->symfonyStyle->success( + sprintf('All %d sets contains the rules from their category', count(self::RULES_DIRECTORY_TO_SET_CONFIG)) + ); return self::SUCCESS; } From 9d5506e417efd215b5b66d466b9f6db4bf0e387a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 8 Jun 2023 16:48:07 +0200 Subject: [PATCH 3/3] make ConvertStaticPrivateConstantToSelfRector part of code-quality set --- config/set/code-quality.php | 2 ++ .../ConvertStaticPrivateConstantToSelfRector.php | 6 ------ utils/Command/MissingInSetCommand.php | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/config/set/code-quality.php b/config/set/code-quality.php index 147e5856839..9a43aafe5b1 100644 --- a/config/set/code-quality.php +++ b/config/set/code-quality.php @@ -10,6 +10,7 @@ use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector; use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector; use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; +use Rector\CodeQuality\Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector; use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector; use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector; use Rector\CodeQuality\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector; @@ -186,5 +187,6 @@ SwitchTrueToIfRector::class, CleanupUnneededNullsafeOperatorRector::class, DisallowedEmptyRuleFixerRector::class, + ConvertStaticPrivateConstantToSelfRector::class, ]); }; diff --git a/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php b/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php index 743e26c5955..f15dad6cb95 100644 --- a/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php +++ b/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php @@ -9,7 +9,6 @@ use PhpParser\Node\Identifier; use PhpParser\Node\Name; use PhpParser\Node\Stmt\Class_; -use PhpParser\Node\Stmt\ClassMethod; use Rector\Core\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -121,11 +120,6 @@ private function isPrivateConstant(ClassConstFetch $classConstFetch, Class_ $cla return false; } - private function isUsedInPrivateMethod(ClassMethod $classMethod): bool - { - return $classMethod->flags === Class_::MODIFIER_PRIVATE; - } - private function shouldBeSkipped(Class_ $class, ClassConstFetch $classConstFetch): bool { if (! $this->isUsingStatic($classConstFetch)) { diff --git a/utils/Command/MissingInSetCommand.php b/utils/Command/MissingInSetCommand.php index c8acad69c80..376720008b2 100644 --- a/utils/Command/MissingInSetCommand.php +++ b/utils/Command/MissingInSetCommand.php @@ -5,7 +5,6 @@ namespace Rector\Utils\Command; use Nette\Utils\Strings; -use Rector\CodeQuality\Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector; use Rector\CodingStyle\Rector\ClassMethod\DataProviderArrayItemsNewlinedRector; use Rector\CodingStyle\Rector\Property\NullifyUnionNullableRector; use Rector\Core\Contract\Rector\ConfigurableRectorInterface; @@ -40,7 +39,6 @@ final class MissingInSetCommand extends Command */ private const SKIPPED_RULES = [ ConfigurableRectorInterface::class, - ConvertStaticPrivateConstantToSelfRector::class, RemoveJustPropertyFetchRector::class, NullifyUnionNullableRector::class, DeclareStrictTypesRector::class,