I'm looking for the "Highlight code -> right-click -> Extract Method" type of functionality I see in Eclipse Java. Does this exist for PHP?
+1
A:
No, most of the refactoring functionality does not work for PHP in Eclipse with PDT. I assume it's because PHP is so much more dynamically typed than Java.
Zend Studio, which is Eclipse with some other extensions has more PHP features, but it will cost you a few hundred bucks.
Scott Saunders
2010-03-17 13:43:25
Dynamic typing's not stopping the refactoring. Refactoring was invented in Smalltalk, probably _the_ most dynamic language around.
Frank Shearar
2010-03-17 14:36:49
@Frank: Thanks for fixing my assumption.
Scott Saunders
2010-03-17 14:53:08
+2
A:
I'm using Zend Studio 7, which is also an Eclipse product, and I can see that option through the "refactor" submenu
Highlight code -> right-click -> Refactor -> Extract Method
Not sure if PHP Eclipse has the same thing.
Peter Bailey
2010-03-17 13:50:52
Eclipse with PDT offers only "Move..." and "Rename..." in the Refactor menu, and those work only on files.
Scott Saunders
2010-03-17 13:58:46
That's unfortunate. Zend Studio allows you to refactor most symbol names (variables, methods, classes) as well as files and directories.
Peter Bailey
2010-03-17 14:33:12
+1
A:
hum, having been one of the phpeclipse developers, the only thing I can say is that: it has never been implemented... refactoring in Java's JDT is a large piece of non-trivial code! doing the same in PHp is even less trivial
Philippe Ombredanne
2010-03-28 20:07:43