代码完成使用魔法__get当私有/受保护成员变量()
-
26-09-2019 - |
题
与具有私有或protected成员变量,而不是诉诸一堆吸气的的或设置成员的类工作时如何设置代码完成功能上的Zend Studio(或任何基于Eclipse的IDE)工作瓦尔公众。
例如:
class Dog {
protected $bark = 'woof!';
public function __get($key) {
if (isset($this->$key)) {
return $this->$key;
}
}
}
$Dog = new Dog();
echo $Dog->bark; // <-- I want the IDE to "know" that bark is a property of Dog.
不隶属于 StackOverflow