Move Class Dialog
The dialog opens when you position the caret at the name of the class in the editor and invoke the refactoring.
PhpStorm supposes that the namespaces in your project are arranged in compliance with the PSR0 standard and enforces you to retain the folder structure and the namespace hierarchy in accordance with this standard when moving classes among namespaces.
When you specify a namespace to move a class to, PhpStorm automatically updates the Target Destination Directory field, which shows the path to the folder where the file that implements the class in question will be stored.
Move class <class name> to namespace
| When the dialog opens, this field shows the namespace to which the class belongs. Specify the fully qualified name of the target namespace. Depending on your use case, this can be: |
Target destination directory
| When the dialog opens, the field shows the path to the folder where the file that implements the class to move is currently stored. |
The path is displayed in the following format:
...\<project root>\<current namespace folder relative to the project root>The path is updated automatically as you specify the namespace to move the class to. However, if you are going to move a class to a non-existing namespace under another parent namespace, PhpStorm will not suggest the proper folder unless you appoint a root folder for your namespace structure by marking the relevant folder as Sources on the Directories page of the Settings/Preferences dialog N/A. See Directories for details.
Do one of the following:
Search in comments and strings
If this checkbox is selected, PhpStorm will look for references to the class to be moved within comments and string literals in source code files.
Search for text occurrences
If this checkbox is selected, PhpStorm will look for references to the class to be moved within documentation, HTML, JSP, various configuration files (for example .yml), and other files included in your project.