Skip to content

RenameStringRector not run after StringClassNameToClassConstantRector #8160

@samsonasik

Description

@samsonasik

Bug Report

Subject Details
Rector version dev-main

Demo URI https://getrector.com/demo/235d76a6-ac47-4265-b207-ca467e803453

Minimal PHP Code Causing Issue

When inside is_a(), the NodeTraverser::DONT_TRAVERSE_CHILDREN stop other rules due to direct NodeTraverser::DONT_TRAVERSE_CHILDREN usage:

if ($node instanceof FuncCall) {
if ($this->isName($node, 'is_a')) {
return NodeTraverser::DONT_TRAVERSE_CHILDREN;
}
return null;
}

It should only stop traverse on current rule, not other rule, other rule with String_ node still need apply.

Expected Behaviour

It should apply:

-            'AnotherClass',
+            'new test',

as different rule.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions