Re: Re: [PEPr] Comment on Networking::Net_Nmap

From: Date: Mon, 10 Mar 2008 15:32:53 +0000
Subject: Re: Re: [PEPr] Comment on Networking::Net_Nmap
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-49361@lists.php.net to get a copy of this message
On Mon, Mar 10, 2008 at 10:21 AM, Luca Corbo <lu.corbo@gmail.com> wrote: > > Thanks to all. It seems to work as reported below, the mistake I made was > to define @property tags inside the class as doc for the property instead of > doc for the class. > > /** > * Service object > * @property int $port The port number where the service is running on. > */ > class Service > { > > private $port; > Yeah, I didn't think to highlight that. The use case for those @property tags that were added in 1.4 were for local variables that you don't choose to declare or initialize, aka "magic" properties, and as such there would be no good docblock *inside* the class to put it in... hence its location in the class docblock. In your case, you *are* declaring your variable, so I personally would go ahead and document it with its own docblock rather than using the class-level property tag. You can mention in that variable's docblock, maybe via an @internal tag, that you must use the __get/__set methods for accessing the variable. -- CRB

« previous php.pear.dev (#49361) next »