Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Service Container | Contextual Binding of the Methods #2651

Open
michael-rubel opened this issue Jun 27, 2021 · 0 comments
Open

Service Container | Contextual Binding of the Methods #2651

michael-rubel opened this issue Jun 27, 2021 · 0 comments

Comments

@michael-rubel
Copy link

michael-rubel commented Jun 27, 2021

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+)?

@michael-rubel michael-rubel changed the title Service Container | Contextual Binding of Methods Service Container | Contextual Binding of the Methods Jun 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant