Refactor Selected Code as a PHP include or require

HI,

Is there a way within PhpStorm to quickly convert the selected code into an include or require.

i.e it would cut the selected code, create a new file, then replace the selected code with an include or require statement to this new file

Naturally with a dialog box to specify the include name.

Just find myself doing this quite often and would like to do it more efficiently.

0
4 comments
Avatar
Permanently deleted user

Hello,

Does Refactor > Move not work for this? For instance, you can move out the class and it will be properly referenced.

0

Vladimir, Refactor > Move does not work as this is about moving a file, not the selection (selected code) within a file.

0

Not possible currently, here's a feature request: https://youtrack.jetbrains.com/issue/WI-35876

0

Excellent - just voted for this - seems kind of obvious to me.....

0

Please sign in to leave a comment.