php - convert from public property access to getter in PHPStorm -


i have project contains many instances of public properties of set of classes being accessed directly via $object->property. after having converted properties protected , having generated getters , setters each property.

i'd refactor each publicly accessed property appropriate getter. there anyway can automated via phpstorm?

find , replace isn't useful because objects have different names in different places.

phpstorm has detected member has protected access. detect appropriate getter generated , make replacement occurs?

unfortunately "encapsulate fields" refactoring option idea not available in phpstorm, it's not possible automate process. may possible write plugin so, far have found, none available.

if read post correctly you've made fields protected , generated getters needed. go on occurrences of access protected properties, create new inspection profile annotator inspections only:

  1. go file -> settings
  2. go editor -> inspections
  3. click manage -> copy create new inspection profile.
  4. disable inspections except of general -> annotator.
  5. now right click project root, click inspect code, , perform inspection new profile. occurrences of protected or private access listed.

i hope @ least useful :)


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -