1
0
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:
nikic 2014-11-03 16:16:15 +01:00
parent 6fad8ff32a
commit 7fbdb79a08
3 changed files with 27 additions and 2 deletions

View File

@ -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 : '')
. ';';
}

View 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;
}
}