File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -342,6 +342,11 @@ static function ($item) {
342342 continue ;
343343 }
344344
345+ /* if CLOSE_TAG is after { on the same line, do not indent. e.g. <?php if ($condition) { ?> */
346+ if ($ tokens [$ tokens ->getNextNonWhitespace ($ startBraceIndex , " \t" )]->isGivenKind (T_CLOSE_TAG )) {
347+ continue ;
348+ }
349+
345350 $ endBraceIndex = $ tokens ->findBlockEnd (Tokens::BLOCK_TYPE_CURLY_BRACE , $ startBraceIndex );
346351
347352 $ indent = $ this ->detectIndent ($ tokens , $ index );
Original file line number Diff line number Diff line change @@ -806,6 +806,14 @@ public function bar() {
806806 }
807807} ' ,
808808 ],
809+ [
810+ '<?php if ($condition) { ?>
811+ echo 1;
812+ <?php } else { ?>
813+ echo 2;
814+ <?php } ?>
815+ ' ,
816+ ],
809817 ];
810818 }
811819
You can’t perform that action at this time.
0 commit comments