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

Bug #19644 Alternative syntax, e.g. if/endif triggers Inline Control Structure error
Submitted: 2012-10-09 15:48 UTC
From: zygous Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version SVN)
PHP Version: 5.4.4 OS: Linux
Roadmaps: (Not assigned)    

 [2012-10-09 15:48 UTC] zygous (Richard Turner)
Description: ------------ I like to use alternative syntax in template files, e.g. if/endif, foreach/endforeach, etc. PHPCS flags-up these usages as examples of inline control structures because it cannot find opening braces. Instead the sniff should check for a colon and corresponding end token and suppress the error message if these are found. Test script: --------------- <?php if (true) { echo 'this is ok'; } if (false) : echo 'this is not ok'; endif;


 [2012-10-17 04:01 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fixed in github repo: cb66c87cd3b203f