Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #17629 PHP_CodeSniffer_Tokens::$booleanOperators missing T_LOGICAL_XOR
Submitted: 2010-07-24 23:11 UTC
From: elazar Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.2.2)
PHP Version: Irrelevant OS: Ubuntu 10.04
Roadmaps: (Not assigned)    
Subscription  


 [2010-07-24 23:11 UTC] elazar (Matthew Turland)
Description: ------------ The array PHP_CodeSniffer_Tokens::$booleanOperators should contain the value T_LOGICAL_XOR, but doesn't. This causes sniffs like PEAR_Sniffs_ControlStructures_MultiLineConditionSniff to report coding standard violations where none exist. Test script: --------------- Running phpcs --standard=PEAR on the following exposes the issue. <?php if (!empty($post) && (!empty($context['header']) xor stripos($context['header'], 'Content-Type')) ) { // ... } Expected result: ---------------- No coding standard violations should be reported. Actual result: -------------- ------------------------------------------------------------------------ -------- FOUND 1 ERROR(S) AND 0 WARNING(S) AFFECTING 1 LINE(S) ------------------------------------------------------------------------ -------- 267 | ERROR | Each line in a multi-line IF statement must begin with a boolean | | operator ------------------------------------------------------------------------ --------

Comments

 [2010-07-25 20:17 UTC] benmatselby (Ben Selby)
 [2010-07-28 10:30 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.