Refactor -> Extract Method -> another Class

Hello !

At the moment I improve a script.
I eliminate duplicate blocks of code and prepare the development of the script.
 Sometimes I find blocks of code that are duplicated.
 Can I outsource these blocks of code in another class ?
I would like to use a similar hand tools Refactor -> Extract Method.
The improvement would be to specify an already existing class.

Your sincerly

Stephan

0
1 comment
Avatar
Permanently deleted user

Hello Stephan,

Can I outsource these blocks of code in another class ?


This action is usually handled in two steps:

  1. Extract code fragement via 'Extract method' refactoring
  2. Move method to another class via 'Move' refactoring


As 'Move' refactoring is not implemented for PHP languaget yet, it is not supported. Please vote - http://youtrack.jetbrains.net/issue/WI-7523

So currently you should perform 'Move' manually.

Sometimes I find blocks of code that are duplicated.

Please look at - http://youtrack.jetbrains.net/issue/WI-5695.

Thank you for feedback!

0

Please sign in to leave a comment.