1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-02 17:28:27 +01:00
PHP-Parser/test/code/formatPreservation/listInsertionIndentation.test

17 lines
392 B
Plaintext
Raw Normal View History

Check correct indentation use when inserting into list node
-----
<?php
$this->foo = new Foo;
$this->foo->a()
->b();
-----
$outerCall = $stmts[1]->expr;
$innerCall = $outerCall->var;
$var = $innerCall->var;
$stmts[1]->expr = $innerCall;
$stmts[2] = new Stmt\Expression(new Expr\MethodCall($var, $outerCall->name));
-----
<?php
$this->foo = new Foo;
$this->foo->a();
$this->foo->b();