class names resolving in use as
zengbo opened this issue · 0 comments
zengbo commented
Version: 4.0.6
Bug Description
When I use a trait method in a class by use as, the trait will use the full name.
Steps To Reproduce
- The origin PHP file
d.php
<?php
use A\B\C
class D
{
use C {
C::abc as acd;
}
}
- Use Phpfile to parse the PHP file and print it
<?php
$php = PhpFile::fromCode(file_get_contents('d.php'));
(new PsrPrinter())->printFile($php);
- output:
<?php
use A\B\C
class D
{
use C {
\A\B\C::abc as acd;
}
}
Expected Behavior
<?php
use A\B\C
class D
{
use C {
C::abc as acd;
}
}
Possible Solution
... Only if you have suggestions on a fix for the bug