-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Rename "exclude tag" to "resource tag" #60002
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resource
is more in line with the name we were searching in #59704 (comment)
But in the ContainerBuilder
, a resource is already a file or directory path to watch. Isn't there a risk of confusion?
Yeah, that is unfortunate... "resource" also makes me think it could be non-classes (js,md,jpg files). |
Naming (data model?)We shouldn't bike shed too much (I'm already ok with this PR and "resource"), but I'd also suggest: $definition->addDataModelTag('entity', ['connection' => 'default']); What we know is that the class is not a service: it's a class that holds data: a "data model" class. Maybe it's an entity, maybe a DTO made by the user, or an The Container's new SuperpowerMore generically, it seems like we're adding a new superpower to the container:
Is that correct? |
|
The word |
Not blocking, but I still have the same feeling as in #59704:
|
I'm for "resource", this is the most generic term. The confusion about config's resources isn't one I would care much about: both things we're talking about are quite advanced concepts that need teaching anyway. |
For the remaining point about the excluding behavior being no longer obvious, what about
|
It's excluded from being a service, but still managed as a resource for invalidating the container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still managed as a resource for invalidating the container.
That convinced me. The definition is a "resource" used during container build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough 👍
Thank you @kbond. |
I find
$definition->addExcludedTag('app.model')
and$containerBuilder->findExcludedServiceIds('app.model')
unintuitive. If feels like your excluding something from the DI container but in fact, your registering it, but in a "different way". The fact that it's an excluded service is just a side-effect. This is especially weird when the tag has attributes ($definition->addExcludedTag('app.model', ['connection' => 'default'])
).Totally open for a name other than "resource".