在使用具有私有或受保护成员变量的类时,如何在Zend Studio(或任何基于
Eclipse的IDE)上设置代码完成功能,而无需使用一组Getter的OR将成员vars设置为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.