1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-30 04:19:30 +01:00
PHP-Parser/test/code/formatPreservation/blockConversion.test
2017-12-26 15:41:38 +01:00

29 lines
353 B
Plaintext

It may be necessary to convert a single statement into a block
-----
<?php
if
($a) $b;
-----
// TODO Avoid fallback
$stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('c'));
-----
<?php
if ($a) {
$b;
$c;
}
-----
<?php
if
($a) {$b;}
-----
$stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('c'));
-----
<?php
if
($a) {$b;
$c;}