Re: PHP_CodeSniffer 1.0.1 on a do while loop
| From: | Laurent Laville | Date: | Mon, 17 Mar 2008 22:31:01 +0000 |
| Subject: | Re: PHP_CodeSniffer 1.0.1 on a do while loop | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-49447@lists.php.net to get a copy of this message | ||
Sorry to disturb, I've found my error (stupid ;-)
} while(1);
} while (1);
A blank is missing
Laurent Laville a écrit :
While I fix lot of errors and warnings on my HTML_Progress2 package,
there is one of them I don't understand
On Preview.php file revision 1.7 [1], I got a :
80 | ERROR | Expected "do {\n...} while (...);\n"; found "...);\n"
What's wrong on this code :
Here is the loop (chunk of code extracted from [1])
do {
$percent = $bar->getPercentComplete();
if ($percent == 1) {
break; // the progress bar has reached 100%
}
$bar->sleep();
$bar->moveNext();
} while(1);
I'll be please if someone can tell me an answer. Did I something wrong, or just a new PHPCS bug ?
Laurent
[1] http://cvs.php.net/viewvc.cgi/pear/HTML_Progress2/Progress2/Generator/Preview.php