Change Signature Dialog
Use the Change Signature dialog to perform the Change Signature refactoring in the PHP context.
Use the available controls to make changes to the function signature. Specify how the function calls should be handled. Optionally, select the calling functions that the added parameters and exceptions (if any) should be propagated to.
Click Refactor to perform the refactoring right away. Click Preview to see the potential changes prior to actually performing the refactoring. (These will be shown in the Find tool window.)
|Visibility||Select the method visibility scope (access level modifier) from the list.|
|Return type||Use this field to modify the function return type. |
Code completion (Ctrl+Space) is available in this field, and also in other fields used for specifying the types.
Setting the function return type is only possible in PHP language version 7.1 and later. You can specify the PHP language level on the PHP page ( for Windows and Linux or for macOS).
|Name||Use this field to modify the function name.|
|Parameters||See the description of the Parameters area.|
|Signature Preview||In this area, the current function signature is shown. (The information in this area is synchronized with the changes you are making to the function signature.)|
Use the Parameters area to manage the function parameters.
The available controls let you add new parameters, remove the existing ones, reorder the parameters and also propagate new parameters to the calling functions (see the descriptions that follow).
In addition to that, you can change the names of the existing parameters.
To start editing a parameter, just click it. Alternatively, use the Up and Down arrow keys to navigate to the parameter of interest and Enter to start modifying it.
|Item||Tooltip and shortcut||Description|
|Use this icon or shortcut to start adding a new parameter. |
Specify the name and default value in the corresponding fields. (The default parameter value is the value (or the expression) to be passed to the function in the function calls.)
You can also propagate the parameters you have added to the calling functions.
|Use this icon or shortcut to delete the selected parameter.|
|Use this icon or shortcut to move the selected parameter one line up in the list of parameters.|
|Use this icon or shortcut to move the selected parameter one line down in the list of parameters.|
|Use this icon or shortcut to propagate the added parameters to the calling functions. |
You can propagate the changes made to the function parameters to any function that directly or indirectly calls the function whose signature you are changing.
(There may be the functions that call the current function. These, in their turn, may be called by other functions. You can propagate the changes to any of the methods in such sequences.)
In the dialog that opens, select the functions you want the changes to be propagated to.
Note that only the selected calling functions and the function calls within them will be affected. That is, the default values will be added into other function calls.
|Create and initialize class properties||The checkbox is available only in the PHP context when the Change signature refactoring is invoked from the constructor of a class. |
For example, you have the following constructor:
If you invoke the Change signature refactoring from the