Skip to content

Commit 0d688ec

Browse files
committed
fix semicolon removal after interpolated anonymous functions
1 parent e4487d7 commit 0d688ec

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

fmt.stub.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13133,6 +13133,12 @@ public function format($source)
1313313133
$this->appendCode($text);
1313413134
break;
1313513135

13136+
case T_CURLY_OPEN:
13137+
case T_DOLLAR_OPEN_CURLY_BRACES:
13138+
$curlyStack[] = $id;
13139+
$this->appendCode($text);
13140+
break;
13141+
1313613142
case ST_CURLY_OPEN:
1313713143
$curlyType = ST_CURLY_OPEN;
1313813144
if (! $touchedFunction) {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
//passes:RemoveSemicolonAfterCurly
3+
4+
function () {
5+
echo "id={$a->id}" . ($a ? '' : '') . ($a ? '' : '') ;
6+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
//passes:RemoveSemicolonAfterCurly
3+
4+
function () {
5+
echo "id={$a->id}" . ($a ? '' : '') . ($a ? '' : '');
6+
};

0 commit comments

Comments
 (0)