Re: PHPCS 1.2.0RC2 and standard rules

From: Date: Fri, 03 Jul 2009 03:41:37 +0000
Subject: Re: PHPCS 1.2.0RC2 and standard rules
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-52303@lists.php.net to get a copy of this message
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. -- Paul M. Jones http://paul-m-jones.com/

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