Moving namespaced classes with PSR-4 autoloader
已回答
Hi,
I am using the PSR-4 autoloader folder structure in my project. If I move a class, ie. `EntityRepository` with namespace `vendor\infrastructure` from the folder `infrastructure` to `infrastructure/entity`, I would like the namespace of the class to be automatically refactored to `vendor\infrastructure\entity`. Is that possible?
Thanks.
请先登录再写评论。
Hi there,
Yes, invoke "Refactor | Move" action on a class (open a file with that class, place caret on the class name, invoke aforementioned action)
You can do similar if you invoke Refactor > Move directly on a class in an Editor:
Nice. Any possibility to have this automated when I simply drag&drop a file in my project tree from one folder to the other?
Not yet. Please vote: https://youtrack.jetbrains.com/issue/WI-39462
Voted.