| Subject |
Details |
| Rector version |
v0.5.21 |
| PHP version |
7.3.4 |
| Full Command |
vendor/bin/rector p src/Test/Exception.php --set=dead-code -n |
Current Behaviour
-class Exception extends \Exception
+use Exception;
+class Exception extends Exception
These changes results in PHP Fatal error: Cannot declare class Test\Exception because the name is already in use, whenever code is processed again by rector or that class is used in another file (i encountered this fatal error when rector was processing next file using that class and it was a bit tricky to find out what is wrong 😄 )
Minimal PHP Code Causing Issue
<?php declare (strict_types=1);
namespace Test;
final class Exception extends \Exception { }
Expected Behaviour
I expect rector to do nothing with this code.
Current Behaviour
These changes results in
PHP Fatal error: Cannot declare class Test\Exception because the name is already in use, whenever code is processed again by rector or that class is used in another file (i encountered this fatal error when rector was processing next file using that class and it was a bit tricky to find out what is wrong 😄 )Minimal PHP Code Causing Issue
Expected Behaviour
I expect rector to do nothing with this code.