Use TypeUtils::getOldConstantArrays in array_column extension#1683
Conversation
|
BTW if you don't plan to make more changes and if you're not just experimenting, you don't need to open the PR as a draft. The problem is that I don't get an email notification when you mark it as ready for review. if you're just waiting for CI results, you can open it as ready-to-merge from the start. If the CI looks green I can merge it sooner. |
|
Good to know. Yeah, just always anxious that ci might be red. Like here :) |
9e47876 to
dc4a54b
Compare
|
how do you wish to have the new Type::getConstantArrays() implemented? :) |
|
Yeah, ConstantArrayType should return IntersectionType I'm not sure about, you can have |
|
And please search and replace the usages programatically, either with a regex in PhpStorm, or write a script that uses PhpParser format-preserving printer and just switch those AST nodes around in a node visitor :) Here's an example: https://github.com/nikic/PHP-Parser/blob/master/doc/component/Pretty_printing.markdown#formatting-preserving-pretty-printing |
right, but I meant mostly how e.g. IntegerType should implement it. I wonder if I should create a new e.g. NotConstantArrayType trait or just implement it returning an empty array in most of the types |
|
Both are valid to me :) I don't like the traits too much but we already accepted that direction so it's fine for me. |
|
fyi I have the Type::getConstantArrays adaption ready and will open the PR after this one got merged :) |
|
Alright, thank you :) |
looks like it made it a tiny bit smarter.
testImprecise4was converted totestConstantArray12