Re: PHP_CodeSniffer and PEAR standard - question on IF statement

From: Date: Sun, 14 Jun 2009 19:10:04 +0000
Subject: Re: PHP_CodeSniffer and PEAR standard - question on IF statement
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-51977@lists.php.net to get a copy of this message
On Sun, Jun 14, 2009 at 8:42 PM, Laurent Laville<pear@laurent-laville.org> wrote: > While I run PHPCS on my proposal PEAR_TestListener, I found on a particular > case. > > While I try to fix the WARNING limit to 85 characters on a IF statement > >      if ($handler->childNodes->item(1) instanceof DOMElement) { > > I've changed it to > >      if ($handler->childNodes->item(1) >          instanceof DOMElement >      ) { > > But then I got this error : > >  128 | ERROR  | Each line in a multi-line IF statement must begin with a >     |        | boolean operator > > How could I fix it ? > I think it's a warning, not an error. So you don't have to be too concerned about it. If you want to work around it, do something like: $foo = $handler->childNodes->item(1); if ($foo instanceof DOMElement) { ... Till

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