php-parser/test/code/formatPreservation/listInsertionIndentation.test
Nikita Popov 4dacbb8d39 FPPP: Fix indentation on list insertion
Use indentation of last list element, instead of indentation
before the insertion point.

Fixes #466.
2018-01-25 22:08:40 +01:00

17 lines
392 B
Plaintext

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();