diff --git a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php index f76efdcafab..42a07bb0817 100644 --- a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php +++ b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php @@ -176,6 +176,10 @@ private function shouldSkip(string $classLikeName): bool } foreach ($this->classesToSkip as $classToSkip) { + if ($this->nodeNameResolver->isStringName($classLikeName, $classToSkip)) { + return true; + } + if ($this->nodeNameResolver->matchesStringName($classLikeName, $classToSkip)) { return true; } diff --git a/rules/Transform/Rector/Class_/AddAllowDynamicPropertiesAttributeRector.php b/rules/Transform/Rector/Class_/AddAllowDynamicPropertiesAttributeRector.php index 01266677bf8..a1659322953 100644 --- a/rules/Transform/Rector/Class_/AddAllowDynamicPropertiesAttributeRector.php +++ b/rules/Transform/Rector/Class_/AddAllowDynamicPropertiesAttributeRector.php @@ -142,6 +142,10 @@ private function shouldSkip(Class_ $class): bool if ($this->transformOnNamespaces !== []) { $className = (string) $this->nodeNameResolver->getName($class); foreach ($this->transformOnNamespaces as $transformOnNamespace) { + if ($this->nodeNameResolver->isStringName($className, $transformOnNamespace)) { + continue; + } + if (! $this->nodeNameResolver->matchesStringName($className, $transformOnNamespace)) { return true; }