Skip to content

Case insensitive conflict import names cause error  #8227

@samsonasik

Description

@samsonasik

Bug Report

Subject Details
Rector version dev-main

Minimal PHP Code Causing Issue

Given the following code:

class Bar 
{
	public static function execute()
    {
    	echo strtolower(\Foo\BaR::execute());
    }
}

It got imported:

-<?php
-
+<?php
+
+use Foo\BaR;
 class Bar 
 {
 	public static function execute()
     {
-    	echo strtolower(\Foo\BaR::execute());
+    	echo strtolower(BaR::execute());
     }
-}
-
+}

which cause error:

Fatal error: Cannot declare class Bar because the name is already in use

see https://3v4l.org/nC7Mq

Expected Behaviour

it should be skipped.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions