Refactor Menu

The Refactor menu allows you to edit names and locations of files and resources.

For more on refactoring, see " Using Refactoring ".

 

The options available from the Refactor menu are:

Name

Shortcut

Description

Rename

Alt+Shift+R

Renames the file/folder/project.

Move

 

Alt+Shift+V

 

Moves the file to a different folder or project

 

Name

 

Shortcut

 

Description

 

Rename

 

Alt+Shift+R

Renames a file or element.

To rename a file, select it from the PHP Explorer view. To rename an element within a file, select it from the PHP Explorer view or highlight it in the editor view.

A rename dialog will open. Enter the new name and click Preview to see all changes that will be made as a result of the rename.

Click OK to implement your changes. All references to the file / element will be automatically updated to reflect the change.

Move

 

Alt+Shift+V

 

Moves a file to a different folder.

To move a file, select it from the PHP Explorer view.

A Move dialog will open. Select the required folder and click Preview to see all changes that will be made as a result of the Move.

Click OK to implement your changes and move the file. All references to the file will be automatically updated to reflect its new location.

Organize Imports

Ctrl+Shift+O

 

Calls PHP objects created in one file to be called into other files within the project.

Use this feature when referencing items in one file which have been created in another file. When referencing an item, click Ctrl+Shift+O. A dialog will be displayed showing that instances of the item have been found in another file, and will display the include calls which will be added in order to call this item into the active file.

Press OK to add an include call for the item into your file.

The Organize Imports feature can also delete references and include calls to files if the relevant items have been deleted, and move "include" calls to the correct location at the top of your script.

Name

 

Shortcut

 

Description

Move

Alt+Shift+V

 

Moves a file to a different folder.

To move a file, select it from the PHP Explorer view.

 A Move dialog will open. Select the required folder and click Preview to see all changes that will be made as a result of the Move.

Click OK to implement your changes and move the file. All references to the file will be automatically updated to reflect its new location.

Rename

Alt+Shift+R

Renames a file or element.

To rename a file, select it from the PHP Explorer view. To rename an element within a file select it from the PHP Explorer view or highlight it in the editor view.

A rename dialog will open. Enter the new name and click Preview to see all changes that will be made as a result of the rename.

Click OK to implement your changes. All references to the file / element will be automatically updated to reflect the change.

Extract Method

Alt+Shift+M

 

Extracts methods from selected code.

 

Extract Local Variable

Alt+Shift+L

 

Extracts variables from selected code.

See Extracting Variables for more information.

Note:

Refactoring options will only be available from within PHP Explorer view and not from Navigator view.
Using the Navigator view's move/rename functions will not update any referenced instances of the file/element.