Re: PHP_CodeSniffer 1.2

From: Date: Thu, 05 Nov 2009 08:46:33 +0000
Subject: Re: PHP_CodeSniffer 1.2
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-53029@lists.php.net to get a copy of this message
On 05/11/2009, at 7:27 PM, Bill Shupp wrote:
It appears that phpcs 1.2 has different handling of multi-line method definitions. With 1.1, the following would pass without warnings: public function directRequest($url,
                                OpenID_Message $message,
                                array $options = array())
{ } In the above, everything is lined up on the left with the first argument, $url. However, with 1.2, this is what I have to do to eliminate warnings: public function directRequest($url, OpenID_Message $message, array $options = array()) { .... } This has the second line of arguments lined up with the "public" keyword, and the opening curly brace on the same line. This looks like a bug - can anyone confirm? If not, then I take issue this this representing the PEAR standard.
PHPCS 1.2 implements the coding standard changes from: http://pear.php.net/pepr/pepr-proposal-show.php?id=538 It's in proposed status, but it will passed by the PEAR group IIRC. According to that, the code should look like this: public function directRequest($url, OpenID_Message $message, array $options = array() ) { .... } But it looks to me that PHPCS is not detecting your code as a multi-line function declaration, so it's not complaining about it like it should. I've noted it down and will fix it. Greg

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