Service Container | Contextual Binding of the Methods
michael-rubel opened this issue · 0 comments
michael-rubel commented
Hello!
It is an interesting concept to be able to control applications using the method binding. But currently, it is limited to use container calls. Why can't we use explicit contextual method binding outside of the constructor to be able to bind the implementation of one method to another without refactoring the app to use those calls?
@taylorotwell mentioned it is a bit complicated (see laravel/docs#4798) even with calls.
I think this would be very powerful if we had to maintain an application with a huge codebase and poor dependency management, Maybe there are some pitfalls that explain why it is still not implemented even in 2021 (requests of this functionality were at Laravel 5+)?