Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class names resolving in use as #128

Closed
zengbo opened this issue Mar 16, 2023 · 0 comments
Closed

class names resolving in use as #128

zengbo opened this issue Mar 16, 2023 · 0 comments

Comments

@zengbo
Copy link

zengbo commented Mar 16, 2023

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

  1. The origin PHP file d.php
<?php

use A\B\C

class D
{
    use C {
       C::abc as acd;
    }
}
  1. Use Phpfile to parse the PHP file and print it
<?php

$php = PhpFile::fromCode(file_get_contents('d.php'));
(new PsrPrinter())->printFile($php);
  1. 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

@dg dg closed this as completed in de1843f Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant