Re: PHPDoc way to describe the magic getter/setters [SOLVED]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 25, 2013 at 4:31 PM, Daevid Vincent <daevid@xxxxxxxxxx> 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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux