As far as I know and gathered from other SO posts, there are no proper tools for refactoring PHP code, so when it comes to refactoring, this is probably a good old search and replacement for most of us, a lot of prayers that we don’t missed.
I would like to know if there are any coding recommendations on how to write code suitable for manual refactoring. Never create variable names from strings, this will be one thing that comes to mind, because such a construction is impossible to grep:
$object->{"field_".$fieldname}
I could imagine that there are several such cases and is not necessary. Maybe someone knows some good resources / articles on this. This should also not be specific to PHP.
source
share