PhpStorm 8.0.0 Web Help

Refactor | Change Signature

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.)

Item Description
Visibility Select the method visibility scope (access level modifier) from the list.
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.)

Parameters area

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 UpUpUpUpUp or Ctrl+PUpUpUpUp or Control PUp or Control PUp or Control P and DownDownDownDownDown or Ctrl+NDownDownDownDown or Control NDown or Control NDown or Control N arrow keys to move to the parameter of interest and EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter to start modifying it.

Item Tooltip and shortcut Description
add Add
Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+Insert or Ctrl+NAlt+InsertCommand N or Control EnterCommand N or Control EnterCommand N or Control Enter
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.

delete Remove
Alt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteCommand DeleteCommand DeleteCommand Delete
Use this icon or shortcut to delete the selected parameter.
arrowUp Up
Alt+UpAlt+UpAlt+UpAlt+UpAlt+Up or Ctrl+Alt+AAlt+UpCtrl+Alt+UpCtrl+Shift+UpControl UpControl UpControl Alt Up
Use this icon or shortcut to move the selected parameter one line up in the list of parameters.
arrowDown Down
Alt+DownAlt+DownAlt+DownAlt+DownAlt+Down or Ctrl+Alt+EAlt+DownCtrl+Alt+DownCtrl+Shift+DownControl DownControl DownControl Alt Down
Use this icon or shortcut to move the selected parameter one line down in the list of parameters.
propagateParameters Propagate Parameters
Alt+G
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.

See Also

Procedures:

Web Resources: