-
Notifications
You must be signed in to change notification settings - Fork 529
Deprecate TypeUtils::getArrays #1687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
getAnyArrays needs to die too in favour of a new method on Type :) |
sounds like a good follow-up :) or also here if you prefer that. I'll continue on Saturday or so I think |
the one failure is the unrelated composer fork integration test again |
My problem here is that |
OK, sure, I'll do the new type method introduction here then soon |
2e5195c
to
4a182f7
Compare
4a182f7
to
1418606
Compare
This should be ready too now. Next on my list would be to reduce usage of |
Thank you! FlattenTypes is a weird one, I'm not sure what that should become on Type... |
Hmm after some thinking I'm not so fond of the two new type methods anymore. What would you think of a |
I'm pretty sure I want those dozens of type methods :) Why would you think otherwise? |
Not entirely sure, it could help with with "unpacking" unions and intersections which is close to what also flattenTypes does. But it's hard. I guess in general I'd like to not see/use any of those type specific things and not have to e.g. handle constant arrays in a special way, but there's currently no way around that I guess |
On the other hand flattenTypes is used very rarely and it essentially just unpacks a union |
I think that we shouldn't replace |
Yeah, right. I guess what bothers me a bit is that we need to have special code so often for specific types which is why we need those methods. E.g. handle constant array optional keys. But I know that there is currently no alternative. At least none without unnecessary overhead |
But I guess that's actually a good argument against the generic method which could promote bad practices :) |
it looks like in all except one internal occurrences |
Yeah, but I want to get rid of all |
exactly! which got me stuck a bit :) |
I think I can get rid of both |
I have the same opinion, they're really not that specific. The only thing I can think of is that if someone wants to do something custom with constant arrays, then they make sense for them. |
good, let me know when you want to release 1.9.0, then I'll get rid of them again. in the meantime I'll try to clean up a bit more |
I don't know yet, we're not in a hurry 😊 There's still some list and assert todos, and I want to see if Native vs. complete types also look really yummy but that might be too ambitious 😊 |
Do you happen to have a public list of those todos? 😁 |
@rvanvelzen I'm sorry, I promised to share that but forgot about that. Here you go: |
Deprecates
TypeUtils::getArrays()
andTypeUtils::getAnyArrays()
in favor ofType::getArrays()
I might be getting a bit greedy now, but this is the first step towards reducing usage of
ConstantArrayType::getAllArrays()