Is there any PHP refactoring tool that would transform a huge noodle code to a proper function based one?
+6
A:
No, you can't do that automatized. Static analysis may reformat your code, eliminate bad practices or inform you about security vulnerabilities, but it can't turn your code into nice and clean OOP.
nikic
2010-10-30 07:54:16
+1 If it was as simple as running a program to generate better code, there wouldn't be so much bad code out there.
eyelidlessness
2010-10-30 07:55:38
@eyelidlessness: and ther facepalms/day ratio would be lower around the globe
cherouvim
2010-10-30 08:01:55
A:
Hi there,
Zend Studio (for Eclipse) has support for refactoring code - it allows you to select a piece of code and extract functions/methods. For example:
It also allows for renaming of variables to further clean up your code. While this is not a fully automated solution, it will significantly help you clean up the mess. Hope this helps.
Edward
2010-10-30 12:16:48