Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum method rename doesn't work #8610

Open
er1z opened this issue Apr 22, 2024 · 0 comments
Open

Enum method rename doesn't work #8610

er1z opened this issue Apr 22, 2024 · 0 comments
Labels

Comments

@er1z
Copy link

er1z commented Apr 22, 2024

Bug Report

Subject Details
Rector version 1.0.4

As I'm part of developer experience team, sometimes we extract pieces of logic into shared libraries. In order to maximize adoption of newly created parts, we want to create as much of automation as possible. The obstacle I'm currently struggling is a problem with renaming enum methods. I recall that some of you mentioned should the methods of IDE used for such of refactoring but we deal of plenty of libraries/projects and want to have simple methods rename.

I did some investigation what happens internally and it turns out that it's got stuck around StaticCall and the problem is around a thing a returned type is MixedType (of enum) parsed into ErrorType before. Hope this gonna at least to narrow the hunting. Tried to debug it within a project but got major version packages collision and usage of phpstan-src was impossible up there. Will try to find something further but will really appreciate your advice if my understanding is not well or anything like that.

Extracted the problem to be posted into demo app below.

Thank you!

Minimal PHP Code Causing Issue

https://getrector.com/demo/d80e9a34-5f7c-4ecc-8f9d-ae2b8abcf7eb

Expected Behaviour

It should behave similar to class method rename.

@er1z er1z added the bug label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant