在 PhpStorm 中自动填充变量、属性和 getters/setters

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

我有一些 class 需要使用大量参数(在某些情况下超过 50 个)来构建。我正在使用 PhpStorm 并且能够快速构建一个属性列表,例如:

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

然后我可以使用 PhpStorm Generate getters / setters 创建 getter 和 setter -- 但由于 class 属性仍然不存在,我收到 Field declared dynamically 警告IDE.

有没有办法自动生成属性?例如

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

您可以使用多选功能。

操作方法如下:https://www.youtube.com/watch?v=fFy1FeNnl7A&feature=youtu.be

官方博客:https://blog.jetbrains.com/phpstorm/2014/03/working-with-multiple-selection-in-phpstorm-8-eap/