Re: PHPCS 1.2.0RC2 and standard rules

From: Date: Fri, 03 Jul 2009 04:34:20 +0000
Subject: Re: PHPCS 1.2.0RC2 and standard rules
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-52305@lists.php.net to get a copy of this message
On 03/07/2009 12:41 AM, Paul M Jones wrote:
On Jul 2, 2009, at 16:16 , Laurent Laville wrote:
With PHP_CodeSniffer 1.2.0RC2, it's impossible to write if (preg_match_all( '/^(@[a-zA-Z\-]+)\s+(.+);\s*$/m', $struct, $atRules, PREG_SET_ORDER) ) { Or you get 1931 | ERROR | Each line in a multi-line IF statement must begin with a | | boolean operator 1932 | ERROR | Each line in a multi-line IF statement must begin with a | | boolean operator 1932 | ERROR | Multi-line function call not indented correctly; expected 12 | | spaces but found 16 1932 | ERROR | Closing parenthesis of a multi-line function call must be on a | | line by itself
This is a case where an explaining variable is *so* useful (and I think prettier). $has_matches = preg_match_all( '/^(@[a-zA-Z\-]+)\s+(.+);\s*$/m', $struct, $atRules, PREG_SET_ORDER ); if ($has_matches) { ... } Hope that helps. +1


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