[test] String class name to class constant rector ignore array keys 1539#1540
[test] String class name to class constant rector ignore array keys 1539#1540Aerendir wants to merge 2 commits intorectorphp:masterfrom Aerendir:StringClassNameToClassConstantRector-ignore-array-keys-1539
Conversation
|
First commit says, that keys are ignored. Would you add test with namespaces class that proves that? |
|
@TomasVotruba no, it is not clear my comment: it says that if I call But instead, the key is transformed into |
This is expected behavior: -'SomeClass' => new SomeClass
+'SomeClass::class' => new SomeClassImagine the 'SomeClass' would be skipped here and during refactoring the 'SomeClass' => new AnotherClass |
|
@TomasVotruba , in my case it is not intended as the name of a class but, instead, as a key by which I can get the Exception. Maybe I need to change the name of my key to something like |
|
Why is it upper class anyway? How do you use it? |
|
@TomasVotruba there is no particular reason: I simply wrote it this way 😅. You are right: I can simply switch to lowercase, am I right? |
|
I see :) lowercase would be better in this particular case. We'll see how it's used in the wild |
|
Resolved by #1565 Thanks for the test case |
rectorphp/rector-src@127ab54 [PHPStan] Clean up PHPStan ignore errors (#1540)
Issue #1539.