mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-30 04:29:15 +01:00
Don't include whitespace directly in catch/finally print
This commit is contained in:
parent
5e565e8046
commit
cb5dd28985
@ -757,18 +757,18 @@ class Standard extends PrettyPrinterAbstract
|
||||
|
||||
protected function pStmt_TryCatch(Stmt\TryCatch $node) {
|
||||
return 'try {' . $this->pStmts($node->stmts) . "\n" . '}'
|
||||
. $this->pImplode($node->catches)
|
||||
. ($node->finally !== null ? $this->p($node->finally) : '');
|
||||
. ($node->catches ? ' ' . $this->pImplode($node->catches, ' ') : '')
|
||||
. ($node->finally !== null ? ' ' . $this->p($node->finally) : '');
|
||||
}
|
||||
|
||||
protected function pStmt_Catch(Stmt\Catch_ $node) {
|
||||
return ' catch (' . $this->pImplode($node->types, '|') . ' '
|
||||
return 'catch (' . $this->pImplode($node->types, '|') . ' '
|
||||
. $this->p($node->var)
|
||||
. ') {' . $this->pStmts($node->stmts) . "\n" . '}';
|
||||
}
|
||||
|
||||
protected function pStmt_Finally(Stmt\Finally_ $node) {
|
||||
return ' finally {' . $this->pStmts($node->stmts) . "\n" . '}';
|
||||
return 'finally {' . $this->pStmts($node->stmts) . "\n" . '}';
|
||||
}
|
||||
|
||||
protected function pStmt_Break(Stmt\Break_ $node) {
|
||||
|
@ -150,7 +150,7 @@ $var = 'abc'
|
||||
try {
|
||||
} catch (X
|
||||
$y) {
|
||||
} finally {
|
||||
} finally {
|
||||
}
|
||||
-----
|
||||
<?php
|
||||
|
Loading…
Reference in New Issue
Block a user