Coding Standards Question

From: Date: Tue, 03 Oct 2006 23:51:39 +0000
Subject: Coding Standards Question
Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-3952@lists.php.net to get a copy of this message
Hi everyone, I've had a bug submitted for PHP_CodeSniffer (a package that checks code for violations of the PEAR coding standards) about comments inside function calls. I'm not sure what the convention is here so I'm not sure if I should throw an error, a warning, or nothing. This is an example: $wrapped = wordwrap($line, 27, "\n", true /*wrap long words*/); And this would be the (very) extreme example: $wrapped = wordwrap($line /*line to wrap*/, 27 /*length to wrap*/, "\n", true /*wrap long words*/); The coding standard doc on function calls doesn't mention comments inside the call itself. http://pear.php.net/manual/en/standards.funcalls.php So my question is, should comments inside function calls be first stripped out and then the resulting form of the function call checked? or should comments inside function calls be disallowed in favor of either a docblock comment for the "wordwrap" function, or a comment above the function call itself? Thanks Greg

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