-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.6] Adds bulk binding ability to service providers during registration #21961
Conversation
ce7a23d
to
b260212
Compare
Simple & Easy. Good one! |
You describe this feature as if it can be used to bind many things at once. So, ...
|
I think you obviously are misunderstanding this PR.
This is for simplification of trivial bindings. For more complex things like
factories you have the traditional way.
El 5 nov. 2017 18:21, "Simon Svensson" <notifications@github.com> escribió:
… You describe this feature as if it can be used to bind many things at
once. So, ...
1. How do I use this with factory functions?
2. How do I specify the $shared parameter for $app->bind($abstract,
$concrete = null, $shared = false)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#21961 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIijHyRYf1ZY6kVsctuRjU_nOhNlpvzpks5sze6QgaJpZM4QSas4>
.
|
Exactly, it's meant to be a clean way to create many trivial bindings. |
No plans to add this to core. |
Re-opening this after sleeping on it. Reconsidering. |
This could be a good feature to simplify code in ServiceProviders as |
Good addition! Congratulations @dallincoons |
Seems like "singletons" and "bindings" would be more consistent here, instead of "singletons" and "bind". |
@dallincoons i was about to use this feature, but it didn't work and after some time, i found that this was merged into 5.6 instead of 5.5, can you update your PR title?, thanks! /cc @taylorotwell |
@devcircus it seems to be changed right as you proposed (I haven't seen who contributed it, sorry if it was you). framework/src/Illuminate/Foundation/Application.php Lines 592 to 602 in 7580798
|
Yeah I noticed. Wasn't me, but I like it. |
@a-komarev and @devcircus, it was @taylorotwell in 81e29b1 and i agree with you guys, it is way better 🤘 And by the way, thanks for the title update 😄 |
This provides a convenient way to add many trivial bindings at once which may clean up service providers which involve many container bindings.