A name is imported twice with use
What it finds
The same name imported twice with use: the second import adds nothing, and if it gives a different alias, the file refers to one class by two names.
From the rule's source, duplicate_import.rs.
<?phpnamespace App; use App\Models\User;use App\Models\Post;use App\Models\User;tx0 reports: app\models\user is already importeduse function App\Support\helper; function make(){ return [new User(), new Post(), helper()];} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/php:duplicate-import" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/php:duplicate-import] reason="..."tx0 explain tx0/php:duplicate-import shows the same in the terminal. Found a false positive? Report it.