mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-30 04:29:15 +01:00
Move leading space out of pStmt_ElseIf
This is not part of the elseif itself and as such belongs in the pStmt_If printer.
This commit is contained in:
parent
310155832a
commit
e3888cbe02
@ -716,12 +716,12 @@ class Standard extends PrettyPrinterAbstract
|
||||
protected function pStmt_If(Stmt\If_ $node) {
|
||||
return 'if (' . $this->p($node->cond) . ') {'
|
||||
. $this->pStmts($node->stmts) . $this->nl . '}'
|
||||
. $this->pImplode($node->elseifs)
|
||||
. ($node->elseifs ? ' ' . $this->pImplode($node->elseifs, ' ') : '')
|
||||
. (null !== $node->else ? $this->p($node->else) : '');
|
||||
}
|
||||
|
||||
protected function pStmt_ElseIf(Stmt\ElseIf_ $node) {
|
||||
return ' elseif (' . $this->p($node->cond) . ') {'
|
||||
return 'elseif (' . $this->p($node->cond) . ') {'
|
||||
. $this->pStmts($node->stmts) . $this->nl . '}';
|
||||
}
|
||||
|
||||
|
@ -1076,7 +1076,7 @@ abstract class PrettyPrinterAbstract
|
||||
//'Expr_ShellExec->parts' => '', // TODO These need to be treated more carefully
|
||||
//'Scalar_Encapsed->parts' => '',
|
||||
'Stmt_Catch->types' => '|',
|
||||
'Stmt_If->elseifs' => '', // TODO move space out of ElseIf printer?
|
||||
'Stmt_If->elseifs' => ' ',
|
||||
'Stmt_TryCatch->catches' => ' ',
|
||||
|
||||
// comma-separated lists
|
||||
|
Loading…
Reference in New Issue
Block a user