mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-26 20:14:46 +01:00
Tweak node insertion formatting
This commit is contained in:
parent
291bb27f6a
commit
1ec5591574
@ -521,6 +521,10 @@ abstract class PrettyPrinterAbstract
|
||||
} else {
|
||||
$subStartPos = $pos;
|
||||
}
|
||||
if (null === $extraLeft && null !== $extraRight) {
|
||||
// If inserting on the right only, skipping whitespace looks better
|
||||
$subStartPos = $this->skipRightWhitespace($subStartPos);
|
||||
}
|
||||
$subEndPos = $subStartPos - 1;
|
||||
}
|
||||
|
||||
@ -1128,7 +1132,7 @@ abstract class PrettyPrinterAbstract
|
||||
'Expr_ArrayItem->key' => [null, null, ' => '],
|
||||
'Expr_Closure->returnType' => [')', ' : ', null],
|
||||
'Expr_Ternary->if' => ['?', ' ', ' '],
|
||||
'Expr_Yield->key' => [T_YIELD, ' ', ' => '],
|
||||
'Expr_Yield->key' => [T_YIELD, null, ' => '],
|
||||
'Expr_Yield->value' => [T_YIELD, ' ', null],
|
||||
'Param->type' => [null, null, ' '],
|
||||
'Param->default' => [null, ' = ', null],
|
||||
@ -1136,7 +1140,7 @@ abstract class PrettyPrinterAbstract
|
||||
'Stmt_ClassMethod->returnType' => [')', ' : ', null],
|
||||
'Stmt_Class->extends' => [null, ' extends ', null],
|
||||
'Stmt_Continue->num' => [T_CONTINUE, ' ', null],
|
||||
'Stmt_Foreach->keyVar' => [T_AS, ' ', ' => '],
|
||||
'Stmt_Foreach->keyVar' => [T_AS, null, ' => '],
|
||||
'Stmt_Function->returnType' => [')', ' : ', null],
|
||||
//'Stmt_If->else' => [null, ' ', null], // TODO
|
||||
'Stmt_Namespace->name' => [T_NAMESPACE, ' ', null],
|
||||
|
@ -114,8 +114,8 @@ $x
|
||||
:
|
||||
$y;
|
||||
|
||||
yield $k =>
|
||||
$v ;
|
||||
yield
|
||||
$k => $v ;
|
||||
yield $v ;
|
||||
|
||||
break 2
|
||||
@ -139,8 +139,8 @@ X extends \Bar
|
||||
|
||||
foreach (
|
||||
$x
|
||||
as $z =>
|
||||
$y
|
||||
as
|
||||
$z => $y
|
||||
) {}
|
||||
|
||||
static
|
||||
|
Loading…
Reference in New Issue
Block a user