This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/vendor/nikic/php-parser/test/code/formatPreservation/blockConversion.test
2018-11-23 12:29:20 +00: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;}