Skip to content

Remove unused import remove a used symbol #9402

@theofidry

Description

@theofidry

Bug Report

Subject Details
Rector version fe7432

Under some circumstances, Rector removes an import statement for a used symbol.

Minimal PHP Code Causing Issue

https://getrector.com/demo/6a604453-8149-4f01-a244-d4553ed0d41c

Expected Behaviour

The use App\Entity; should not be moved.


This seems to be due to the usage of both the phpdoc and the attribute. When the attribute is not present Rector doesn't remove this use statement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions