-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Renamed some PHP-DSL functions #36800
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.
I'm sorry I'm unable to have a strong opinion on this. Both ways have merits.
Does anyone have some rationale to share that could help decide here?
My rationale was that when looking at this: ->args([ref(Bar::class), service('stdClass')]) Without reading Symfony Docs, you can understand it as follows:
Both assumptions are wrong ... so you must read the docs and learn about this. However, to me at least, the proposed methods are self-explanatory and they can be understood without reading or learning anything: ->args([service(Bar::class), inline_service('stdClass')]) OK, inject a service and then inline a service. (you still need to read the docs to learn everything about those methods ... but the learning curve has softened dramatically in the second case). |
I am (currently) not a big fan of PHP configuration. Probably because I never used it. =) So, with my fresh eyes, using |
My biggest concern is BC compatibility 😛 |
Actually I like short names in this config file: I'm downvoting because:
nb: @Nyholm you should have a try.. It's much more convenient than xml/yaml configuration. Autocompletion just work with className, constant, etc, You can leverage language by using loop/if and more... it just work |
Hi! 3 things from me:
So, I like it :) |
src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php
Outdated
Show resolved
Hide resolved
Do you update blog posts like this when such changes are made ? |
@GromNaN no. We would do a new blog post. The new feature of 3.4 does not change when we refactor it in 5.1. 3.4 still has the old names. |
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.
<argument type="service" id="foo">
that one convinced me!
d5f3b75
to
366405b
Compare
Thank you @javiereguiluz. |
As discussed in #36778, Symfony wants to move from XML to PHP for its own configuration. I propose these function renames to make the PHP-DSL a bit easier to understand: