mirror of
https://github.com/danog/PHP-Parser.git
synced 2025-01-20 12:46:47 +01:00
Fix whitespace when printing trait alias modifiers
This commit is contained in:
parent
6fad8ff32a
commit
7fbdb79a08
@ -541,7 +541,7 @@ class Standard extends PrettyPrinterAbstract
|
||||
public function pStmt_TraitUseAdaptation_Alias(Stmt\TraitUseAdaptation\Alias $node) {
|
||||
return (null !== $node->trait ? $this->p($node->trait) . '::' : '')
|
||||
. $node->method . ' as'
|
||||
. (null !== $node->newModifier ? ' ' . $this->pModifiers($node->newModifier) : '')
|
||||
. (null !== $node->newModifier ? ' ' . rtrim($this->pModifiers($node->newModifier), ' ') : '')
|
||||
. (null !== $node->newName ? ' ' . $node->newName : '')
|
||||
. ';';
|
||||
}
|
||||
|
25
test/code/prettyPrinter/traitUse.test
Normal file
25
test/code/prettyPrinter/traitUse.test
Normal file
@ -0,0 +1,25 @@
|
||||
Trait uses and adaptations
|
||||
-----
|
||||
<?php
|
||||
|
||||
class A
|
||||
{
|
||||
use B, C, D {
|
||||
f as g;
|
||||
f as private;
|
||||
f as private g;
|
||||
B::f as g;
|
||||
B::f insteadof C, D;
|
||||
}
|
||||
}
|
||||
-----
|
||||
class A
|
||||
{
|
||||
use B, C, D {
|
||||
f as g;
|
||||
f as private;
|
||||
f as private g;
|
||||
B::f as g;
|
||||
B::f insteadof C, D;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user