views:

50

answers:

3

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
Dynamic typing's not stopping the refactoring. Refactoring was invented in Smalltalk, probably _the_ most dynamic language around.
Frank Shearar
@Frank: Thanks for fixing my assumption.
Scott Saunders
+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
Eclipse with PDT offers only "Move..." and "Rename..." in the Refactor menu, and those work only on files.
Scott Saunders
That's unfortunate. Zend Studio allows you to refactor most symbol names (variables, methods, classes) as well as files and directories.
Peter Bailey
That is sad. I had hoped I was just missing some Eclipse package...
Alex R
+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