idea-php-symfony2-plugin icon indicating copy to clipboard operation
idea-php-symfony2-plugin copied to clipboard

Bulk replacement of class constants

Open jortwiz opened this issue 2 years ago • 4 comments

Hi,

I have a Symfony 4 project which contains a few thousand references to ->getRepository('bundle:class'). All of these should be refactored to class constants.

The plugin automatically offers the replacement through the context menu, however I haven't found a way to apply these changes in bulk.

Is there any way to do this?

Thanks

jortwiz avatar Apr 05 '23 09:04 jortwiz

  • yes there is. press ALT+enter in context
  • but other then form types class converting i never implemented full inspections which allowing them to run project wide; maybe quick win for next update

image

but also the good "old" rectorphp provide this also:

https://github.com/rectorphp/rector-doctrine/blob/main/docs/rector_rules_overview.md#entityaliastoclassconstantreferencerector

Haehnchen avatar May 09 '23 17:05 Haehnchen

For single replacements I already have this keybound, being able to run this as a project-wide inspection would be a great addition. Thanks for taking this into consideration.

jortwiz avatar May 24 '23 12:05 jortwiz