![](/img/trans.png)
[英]Eclipse IDE: Code completion for the private and protected properties accessed by magic functions
[英]Code Completion for private/protected member variables when using magic __get()
在處理具有私有或受保護成員變量的類時,如何設置代碼完成以在Zend Studio(或任何基於Eclipse的IDE)上工作,而不需要使用一堆Getter,或者將成員變量設置為public。
例如:
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.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.