Skip to content

Commit bbaf20f

Browse files
committed
2 parents 2b845d1 + 898d911 commit bbaf20f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ public function process(File $phpcsFile, $stackPtr)
142142
return;
143143
}
144144

145-
if ($tokens[$nextNonEmpty]['code'] === T_COLON) {
146-
// Alternative control structure.
145+
if ($tokens[$nextNonEmpty]['code'] === T_OPEN_CURLY_BRACKET
146+
|| $tokens[$nextNonEmpty]['code'] === T_COLON
147+
) {
148+
// T_CLOSE_CURLY_BRACKET missing, or alternative control structure with
147149
// T_END... missing. Either live coding, parse error or end
148150
// tag in short open tags and scan run with short_open_tag=Off.
149151
// Bow out completely as any further detection will be unreliable

0 commit comments

Comments
 (0)