Re: Coding Standards Question
| From: | Alan Knowles | Date: | Wed, 04 Oct 2006 01:18:08 +0000 |
| Subject: | Re: Coding Standards Question | ||
| References: | 1 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-3953@lists.php.net to get a copy of this message | ||
I dont think you should strip them out... I can think of a few places
they are essential..
$x = someclass:factory(array(
'test' => 'xxx', // make sure we do testing
'debug' => 1, // ....
);
for checking - just ignore their existance...
Regards
Alan
Greg Sherwood wrote:
> 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
>