go to bug id or search bugs for
So basically if I build my datastructures using SplObjectStorage logic I cannot define properly an interface for my each collection and force usage of a subtype for each of the attach/detach and add/remove methods.
For example I want to build a ProductCollection which expect working with only the same type when adding and removing and also has a boundary to only accept ProductEntity I cannot define the interface properly since the SplObjectStorage is bound to itself not to an interface.
Sure you can do it with abstract classes and define this boundaries but then each of your collection abstractions would be separated from your other interfaces and you loose polymorphic dependencies or you need to drop your architecture and care this differently.
This change should not provide any BC issues, since it's just add interface around the ObjectStorage but it will allow polymorphic interfaces and more tools to design your architecture without implementing code.
Add a Patch
Add a Pull Request
This description is very confusing to me, because I don't understand how having an interface for SplObjectStorage will help you with a ProductCollection based on SplObjectStorage. The ProductCollection will still have to satisfy that interface, which is not possible if you restrict the types of accepted objects and our LSP checks will prohibit it. Something akin to this is only possible using generics. Am I misunderstand this request?
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.