Code Completion for private/protected member variables when using magic __get() Code Completion for private/protected member variables when using magic __get() php php

Code Completion for private/protected member variables when using magic __get()


Code Completion for Magic Methods can be achieved by using the @property and @method annotation in the DocBlock of the class (not in the Method Docs).

/** * @property string bark */class Dog {    /* ... */}$Dog = new Dog();echo $Dog-> // will autocomplete now

Note that there is no correlation between the actual code and the annotation. Zend Studio will show whatever you set for @property, regardless of this property existing. It will also not check if there actually is a magic method available.

Code Completion in Zend Studio with @property annotation