Skip to content

Commit 9bc9f79

Browse files
committed
fix - formatting error - kokororin/vscode-phpfmt#186
1 parent 82c18df commit 9bc9f79

4 files changed

Lines changed: 42 additions & 2 deletions

File tree

fmt.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4921,7 +4921,7 @@ public function format($source) {
49214921
if (count($attributeStack)) {
49224922
$this->printUntil(T_END_HEREDOC);
49234923
} else {
4924-
$this->printUntil(ST_SEMI_COLON);
4924+
$this->printUntil(T_END_HEREDOC);
49254925
}
49264926
break;
49274927

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
//passes:AutoSemicolon
3+
// Have a free MRE for both options. Run the formatter over this and both will break.
4+
print_r(<<<SQL
5+
SELECT *
6+
FROM EXAMPLE
7+
WHERE foo = 'bar'
8+
OR answer = 42
9+
SQL) or die("Imagine this being a function that produced a proper HTTP 500 error page and a log entry");
10+
11+
function do_or_die() {
12+
print_r(<<<'SQL'
13+
SELECT *
14+
FROM EXAMPLE
15+
WHERE foo = 'bar'
16+
OR answer = 42
17+
SQL)
18+
or die("Imagine this being a function that produced a proper HTTP 500 error page and a log entry");
19+
}
20+
do_or_die();
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
//passes:AutoSemicolon
3+
// Have a free MRE for both options. Run the formatter over this and both will break.
4+
print_r(<<<SQL
5+
SELECT *
6+
FROM EXAMPLE
7+
WHERE foo = 'bar'
8+
OR answer = 42
9+
SQL) or die("Imagine this being a function that produced a proper HTTP 500 error page and a log entry");
10+
11+
function do_or_die() {
12+
print_r(<<<'SQL'
13+
SELECT *
14+
FROM EXAMPLE
15+
WHERE foo = 'bar'
16+
OR answer = 42
17+
SQL)
18+
or die("Imagine this being a function that produced a proper HTTP 500 error page and a log entry");
19+
}
20+
do_or_die();

tests/PSR/035-concat-method-with-heredoc.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class Child extends ParentClass
66
return <<<EOF
77
HEREDOC
88
EOF
9-
.parent::parentalMethod();
9+
. parent::parentalMethod();
1010
}
1111
}

0 commit comments

Comments
 (0)