Bug 183807 - Extract method
Extract method
Status: NEW
Product: php
Classification: Unclassified
Component: Refactoring
All All
: P3 with 65 votes (vote)
: 8.0.1
Assigned To: Ondrej Brejla
Depends on:
  Show dependency treegraph
Reported: 2010-04-09 20:03 UTC by alexey_vasilyev
Modified: 2016-10-06 09:06 UTC (History)
7 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description alexey_vasilyev 2010-04-09 20:03:56 UTC
I need a new refactoring feature for PHP IDE:  "Extract method"

Use case:

1. User having a some code in method/function and would like to extract some common functionality to new method. 
2. User selects some lines which must be extracted, and call "extract method" feature. 
3. IDE asks  method name from user and confirm new method parameters
4. User confirms all.
5. IDE extracts code to new method.

Similar functionality implemented in ReSharper for C# (MSVS), but I would like having same in NetBeans for PHP.
Comment 1 Filip Zamboj 2010-09-15 12:31:16 UTC
batch reassigning
Comment 2 martinvium 2010-12-14 10:27:16 UTC
The "Introduce Method" refactoring already available in Netbeans for Java is pretty much perfect for me:

Comment 3 cgalive 2011-09-29 18:35:28 UTC
It would be really nice to have actual code refactoring features for php in an open source IDE.
Comment 4 patkoscsaba 2012-06-06 19:46:31 UTC
Any news an this one? When I saw that it was marked "target milestone = next" back in April, I thought it will be in 7.2. Still I can't find any new PHP refactoring in the nightly build.
Comment 5 stfalcon 2012-08-27 15:08:42 UTC
there anybody? it's a very important feature for IDE
Comment 6 Ondrej Brejla 2012-08-27 15:10:47 UTC
I plan to implement some new refactorings, but it's no time for 7.3. So probably it will be in some of later releases.
Comment 7 dextervip 2012-09-10 23:12:16 UTC
It's a must have feature!
Comment 8 songoko20000 2012-10-09 11:43:59 UTC
This feature is really important and highly demanded. Please implement it soon.
Comment 9 messaged 2013-08-21 13:15:20 UTC
+1 Missing that feature
Comment 10 patkoscsaba 2013-10-20 11:52:15 UTC
Any progress on this one? It's been 3 and a half years since it was reported...
Comment 11 Nowaker 2013-10-20 11:55:27 UTC
Just go use PhpStorm... You will die waiting with this pace of development.
Comment 12 messaged 2013-10-20 11:56:14 UTC
And that feature is already implemented for Java files...
Comment 13 rjmunro 2014-01-03 16:24:10 UTC
It might be easiest for Netbeans to act as a front end to this project:

which impliments some refactoring features on the command line.
Comment 14 Rayhan-Muktader 2014-01-23 15:06:42 UTC
This is a must have feature for modern PHP coding.
NetBeans is adding support for many modern PHP frameworks to attract users. It will need to add features like these to actually retain those users.
Comment 15 sandreas 2014-05-09 13:46:58 UTC
Please go for it!
Comment 16 artem56 2014-06-10 17:44:07 UTC
Comment 17 VaclavSir 2014-06-11 07:10:53 UTC
Don't write those "+1" comments, use the vote link next to the priority. +1 comments have no relevance. Or just go download PhpStorm, as has been said...
Comment 18 sandreas 2014-06-11 08:05:51 UTC
@VaclavSir: ok, did it, thx. 

P.S.: Kind of odd to recommend PHPStorm twice in this Bug...
Comment 19 lukasz.gawron 2014-11-30 10:10:31 UTC
What is status of this? I have 8.0.1 but still PHP refactoring is very poor. In 8.0.2 changelog nothing about PHP refactoring is mentioned.
Comment 20 Igorock 2014-12-29 20:25:11 UTC
Comment 21 michaelleb 2015-02-23 14:36:37 UTC
For all people that need "extract method" feature. NetBeans has other awesome feature that you can use instead :

php templates with parameter hint.

you can easily surround selected code with function template declaration and even 
add your custom templates.
If you are not familiar with this feature, I strongly recommend to read about it here:



Try it NOW (works in NB > 7.3):
1.select the code you want to extract.
2.press alt+enter, select "Surround with public function" from hint dialog menu.

Happy coding!
Comment 22 Smolarium 2016-10-06 08:50:47 UTC
PhpStorm has it. Why not NetBeans?
This is most usefull feature ever. Please make it :)
Comment 23 Nowaker 2016-10-06 09:06:49 UTC
> Nowaker 2013-10-20 11:55:27 UTC
> Just go use PhpStorm... You will die waiting with this pace of development.

Told you!

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo