【问题标题】:PHPDoc / PhpStorm protected members in autocomplete list自动完成列表中受 PHPDoc / PhpStorm 保护的成员
【发布时间】:2016-09-18 23:43:39
【问题描述】:

是否可以在自动完成列表中显示受保护的成员? 例如:

class Foo
{
    protected $bar;
    public function __get($name) { return $this->$name; }
}

$foo = new Foo();
$foo-> // display autocomplete list with bar

我使用 PhpStorm 10

【问题讨论】:

    标签: php phpstorm phpdoc


    【解决方案1】:

    在类级别的 PHPDoc 注释中使用 @property

    https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md#714-property

    /**
     * @property ProperTypeHere $bar [Optional description]
     */
    class Foo
    {
        protected $bar;
        public function __get($name) { return $this->$name; }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-04-01
      • 1970-01-01
      • 2016-06-12
      • 2014-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多