rector-src icon indicating copy to clipboard operation
rector-src copied to clipboard

NormalizeNamespaceByPSR4ComposerAutoloadRector: Replace references correctly

Open jtojnar opened this issue 3 years ago • 4 comments

Previously, NormalizeNamespaceByPSR4ComposerAutoloadRector did not update references to other normalized classes properly. This change fixes that by recording the renames using RenamedClassesDataCollector.

Supersedes https://github.com/rectorphp/rector-src/pull/2482

jtojnar avatar Jul 09 '22 06:07 jtojnar

Do you need help with this one? It seems almost finished :slightly_smiling_face:

TomasVotruba avatar Aug 16 '22 19:08 TomasVotruba

I have yet to find time to investigate why it still does not work. Not sure when I will be able to work on this.

jtojnar avatar Aug 16 '22 23:08 jtojnar

@jtojnar We'd love to have this feature in Rector :)

What is missing here to make CI pass?

TomasVotruba avatar Oct 13 '22 11:10 TomasVotruba

I would expect the code to work as is so there is something wrong with my assumptions.

Unfortunately, I still have not found a time to dive into Rector innards to learn how rules are interleaved, and how RenamedClassesDataCollector really interacts with namespaces that are modified.

jtojnar avatar Oct 13 '22 18:10 jtojnar

Closing as the buggy rule is now removed to avoid causing harm.

TomasVotruba avatar Jun 04 '23 16:06 TomasVotruba