Re: Re: Need feedback about PEAR Coding Standard relatedto PHP_CodeSnifferusage

From: Date: Wed, 19 Dec 2007 00:29:12 +0000
Subject: Re: Re: Need feedback about PEAR Coding Standard relatedto PHP_CodeSnifferusage
References: 1 2 3 4 5  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-4705@lists.php.net to get a copy of this message
On Dec 18, 2007 5:35 PM, Laurent Laville <pear@laurent-laville.org> wrote: > > if (blah) { > /** > * @param int $p1 > * @param int $p2 > */ > class A ($p1, $p2) {} > } else { > /** > * @param int $p1 > * @param int $p2 > * @ignore > */ > class A ($p1, $p2) {} > } > I've never seen a class declaration like that... I didn't think PHP would allow it. The way I've seen such a situation like this handled before was to use an IF conditional around an INCLUDE statement, where TRUE would include file A and FALSE would instead include file B. If I had to document that piece of code above, I'd probably attempt to use a docblock template before the IF, containing nearly all the class info, and only put minimal *different* info in the two class-adjacent docblocks, and be satisfied until such time as we can help get docblock template support into phpcs. -- CRB Let me introduce you to my very own DMCA-protected encryption key: BC 1B 64 4A 8D DE 49 E8 C3 7D CC EE 1A AD EE F5 (compliments of Freedom-to-Tinker http://www.freedom-to-tinker.com/?p=1155)

« previous php.pear.qa (#4705) next »