-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Introduce ComposerConfigurator #48066
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
0c3aadb
to
fc1e94b
Compare
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.
Thank you for your contribution. The main reason why I'm blocking the merge right now is that the PR does not contain a single test which is a blocker for a new feature.
After reading the code and the linked issue, I still have no idea what problem you are attempting to solve and what Composer has to do with it. Tests are not just some icing on the cake that we can add when we have time for it. Tests also help a reviewer understand how your new feature is meant to be used. Tests could've helped me understand your PR.
Anyway, what does this configurator do?
- Is it loading services from a composer package? If so, that package should probably ship with a bundle instead.
- Is Composer used to discover classes? If so, what's the benefit over the PSR-4 autodiscovery feature that we already have in the DependencyInjection component?
thanks for the review @derrabus
It's a WIP to get an idea of how to implement it.
I'll try to rephrase what the ticket says by comparing what the framework allows and what I'm proposing. current implementation: we can import all classes from a namespace+path, then we put globs to exclude some of them proposal: we import all classes tagged as services we can found in the project's the problem: make it easier to configure applications that use advanced folder structures (hexagonal architecture, ddd)
No, it reads the project's Today we must declare the namespace in both
The current implementation does read The name The main point for the moment I think is to determine whether the problem the issue (and this PR) tries to solve is relevant enough or not. |
So, you're basically solving two independent problems:
The former could indeed be useful if done right. We've just added a PSR-4 discovery feature for the routing component where we had to configure the mapping explicitly again. The latter has been discussed rejected in the past I think. Anyway, I would strongly recommend to pick only one of the two problems. They both come with a certain complexity we should not underestimate. |
I don't see the problem with the current way. Actually, I see the current way as superior since it allows selecting a subset of all possible classes known by composer. So I'm not convinced by this aspect.
This I like it. I'd recommend focusing on this alone, at least as a first step. |
Let's close this PR. There hasn't been any progress after the initial review which was > 1 year ago. @renanbr Feel free to open a new PR if the topic is still relevant to you. |
Refers to #48065 to get information about what this PR does.