views:

58

answers:

2

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
+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
@eyelidlessness: and ther facepalms/day ratio would be lower around the globe
cherouvim
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:

alt text

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