Re: [PHP] PHPDoc way to describe the magic getter/setters [SOLVED]
[email protected] (David Harkness)
| Newsgroups | php.general |
|---|---|
| Message-ID | <CAO8qQLkzNKo8erntaJMtDL_YsPU5EL=DOULNKEB6K22fyOwWeg@mail.gmail.com> |
On Wed, Sep 25, 2013 at 4:31 PM, Daevid Vincent <[email protected]> wrote: > Then I randomly stumbled upon this PHPDoc @ method tag and my whole world > is brighter today than it has been for the past, oh let's say DECADE! Yes, @method and @property are very handy. Out of curiosity, since you're providing magic getters and setters, why not use __get and __set instead of __call with matching on "get_xxx" and "set_xxx"? This would allow using the simpler (and IMHO much more expressive and PHP-ish) forms $obj->foo = $obj->bar + 5; Peace, David