l00k
l00k

Reputation: 1545

PHPDoc / PhpStorm protected members in autocomplete list

Is it possible to display protected members in autocomplete list? For example:

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

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

I use PhpStorm 10

Upvotes: 0

Views: 244

Answers (1)

LazyOne
LazyOne

Reputation: 165228

Use @property in class-level PHPDoc comment.

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; }
}

Upvotes: 2

Related Questions