-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Improve class named services with root namespce #24145
N 8000 ew 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
Conversation
Why? |
Sorry, let me clarify. I tried wiring some legacy/historical classes with DI 3.3, i.e. I expected using a (leading) Yet, by now, i more understand the tradeoff we did. Only However this isnt about Additionally this PR detects Contextual, where a class named service is needed, we could try to lookup both. Or forbid configuring both. I'd prefer that in favor of simply ignoring root namespaced classes (not detected as such). Dont wanna push the change. Point is, currently, the class attribute can contain a leading |
I think I'm 👎 here, both for the |
What's somewhat weird is we detect
Not the goal to introduce class name normalization, but could be applied where needed yes. |
|
as ID :) as class name is fixed by #23468. This is the same regex (spec) applied to ID.
Understand, but reads as "we dont care about class named service feat." :) Usecase is poor man namespacing. Will go with So yes, eventually i think there needs to be a form of class name normalization somewhere. But it's no big deal; just tricky now and then. |
I think it's ok to require ppl with "poor man's namespaces" to add class explicitly, I suggest closing :) |
settled 👍 DX-wise the exception may still be a bit weird; In PHP that's a namespaced class. Should we improve it? |
@ro0NL you won't ever have a class where doing |
But edit: with comparison issues i mean ppl in extensions comparing to |
No bugs :) just never use leading slash in ID or class attr. |
A continuation of #23468
Fixed error for both test cases is
IMHO both qualify as namespaced, making the error look weird (hence bugfix 3.3)
Yes; i know it doesnt work with
get(\DateTime::class)
.. but that's not the point really :)