【发布时间】:2017-12-20 22:26:12
【问题描述】:
举个例子:
class Example
{
private $var;
public function method()
{
$this-> here the IDE will offer the var
}
}
但是如果我有这个怎么办:
class Example
{
//private $var;
public function method()
{
$this-> var will no longer be offered
}
}
所以换句话说,即使没有实际变量,我也希望代码完成工作。那是因为我想使用 __get 方法。很遗憾,我不能使用unset($this->var)。
【问题讨论】:
-
@property $varname在类的文档块中 -
取决于IDE,在eclipse中可以
/*@var $variable class*/