Generating Getters and Setters
On this page:
Introduction
In the PHP context, you can generate accessor and mutator methods (getters and setters) for the fields of in your classes. PhpStorm generates getters and setters with only one argument.
In the PHP context, getters and setters are generated using the PHP getter/setter file template. By default, as specified in these templates, setters are generated with the set
prefix and getters with the set
or get
prefix according to the inferred field type boolean
or con-boolean
. The prefix is the value of the ${GET_OR_IS}
variable in the default getter template. The default template is configured in the Code tab on the File and Code Templates page of the Settings / Preferences Dialog.