phpautocompletephpstormphpstorm-2016.1

Auto-populate variables, properties, and getters / setters in PhpStorm


I have some classes I need to build with a large number of parameters (like 50+ in some cases). I'm using PhpStorm and was able to quickly build a list of properties like:

 * @property string MainKey
 * @property string MainId
 * @property string Affiliation
 * @property string ParticipantYN

I can then use the PhpStorm Generate getters / setters to create the getters and setters -- but since the class properties still don't exist, I'm getting Field declared dynamically warnings in the IDE.

Is there a way to auto-generate the properties? e.g.

 public $MainKey;
 public $MainId;
 public $Affiliation;
 public $ParticipantYN;

Solution

  • You can use multiple selection feature.

    Here is how to do that: https://www.youtube.com/watch?v=fFy1FeNnl7A&feature=youtu.be

    Official blog: https://blog.jetbrains.com/phpstorm/2014/03/working-with-multiple-selection-in-phpstorm-8-eap/