-
Notifications
You must be signed in to change notification settings - Fork 11.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[9.x] Split Conditionable into package #38457
[9.x] Split Conditionable into package #38457
Conversation
Where does it end though? The HigherOrderCollectionProxy also doesn't really have anything to do with collections. It should really be called Wouldn't it make more sense to have some catch-all package, like |
illuminate/utils? |
I like that. But at what point are we just re-creating Would a better approach be to extract some things out of that package, and then make the collections package depend on it again? It feels like |
I firmly believe |
The entire point of illuminate/collection was that it didn't depend on illuminate/support. Honestly I'm beginning to think splitting illuminate/support was a mistake and we should just move everything back into one component. |
This PR has conflicts. |
At this point, for a code to have their own package, it should comply with the following:
For the case of if (in_array(Conditionable::class, class_uses_recursive($object)) {
$object->when(true, ...);
} In that case, you're bound to create a Again, if a single part of the code requires |
@inxilpro can you resolve the conflicts on this? |
@taylorotwell what are your thoughts on this #38457 (comment)? I would really like to eventually rename |
I've resolved the conflicts. I think there are two viable paths:
After thinking about it a bit longer, it feels like moving away from a catch-all "support" package into more tightly scoped feature packages is a good thing. In fact, I think that in relationship to @JosephSilber's comment, it makes a lot of sense to introduce an |
Yeah I don't see what the big controversy is with splitting this out into a package. |
Thanks @inxilpro |
This is a potential solution to #38389.
Realistically, anything that
illuminate/collections
depends on (that's also used elsewhere in the framework) is going to bump into this same issue. It's the same reason theMacroable
trait had to be moved into its own package.The other approach would be to just move
Conditionable
into the Collections package, but that just feels wrong to me. In the end, I decided to PR this as a solution. If you decide it's not worth breaking out another package, I'll happily re-submit the other solution.