Bug #19644 [Opn->Csd]: Alternative syntax, e.g. if/endif triggers Inline Control Structure error

From: Date: Tue, 16 Oct 2012 23:01:04 +0000
Subject: Bug #19644 [Opn->Csd]: Alternative syntax, e.g. if/endif triggers Inline Control Structure error
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-9194@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19644&edit=1 ID: 19644 Updated by: gsherwood@squiz.net Reported By: rjt at zygous dot co dot uk Summary: Alternative syntax, e.g. if/endif triggers Inline Control Structure error -Status: Open +Status: Closed Type: Bug Package: PHP_CodeSniffer Operating System: Linux Package Version: SVN PHP Version: 5.4.4 -Assigned To: +Assigned To: squiz Roadmap Versions: New Comment: -Status: Open +Status: Closed -Assigned To: +Assigned To: squiz Fixed in github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/c18e898d2ed02c775bbc904e8 cb66c87cd3b203f Previous Comments: ------------------------------------------------------------------------ [2012-10-09 11:48:15] zygous 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; ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19644&edit=1

« previous php.pear.bugs (#9194) next »