-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Allow array attributes for service tags #47364
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
Hey! I think @nusje2000 has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
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.
Thanks for reopening.
LGTM, just some nitpicking.
src/Symfony/Component/DependencyInjection/Loader/Configurator/DefaultsConfigurator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
Outdated
Show resolved
Hide resolved
@aschempp Just wanted to say how happy I am that you didn't give up on this idea and finished the PR 👏 🙌 💙 |
src/Symfony/Component/DependencyInjection/Loader/Configurator/DefaultsConfigurator.php
Outdated
Show resolved
Hide resolved
8be8031
to
edd8d77
Compare
Thank you @aschempp. |
Hi @aschempp, I can't get this feature to work. $configurator->services()
->set(Foo::class)
->tag('foo', ['bar' => ['baz' => 42]); throws:
The tag is accepted by the Am I missing something or should I open an issue ? |
@ju1ius looks like you're the first to actually use the feature 😅 |
@nicolas-grekas OK, will take a stab at it during the week. |
@nicolas-grekas Done in #48958 😉 |
…bute values (ju1ius) This PR was squashed before being merged into the 6.2 branch. Discussion ---------- [DependencyInjection] fixes validation of non-scalar attribute values | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #48956 | License | MIT | Doc PR | None As a follow-up to #47364, this PR updates the `CheckDefinitionValidityPass` to allow (possibly nested) arrays of scalars in service tags attribute values. Please see #48956 for context. Commits ------- 88b3e15 [DependencyInjection] fixes validation of non-scalar attribute values
…so a 'name' property (lyrixx) This PR was merged into the 6.4 branch. Discussion ---------- [DependencyInjection] fix XmlDumper when a tag contains also a 'name' property | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT Since #47364, the tag can contain an **array** of attributes. And since #47364, SF uses it to store workflow metadata and also a **name** property. It likely broke the XML generation, and so it brokes `debug:router` command for instance. Sorry, I didn't notice it before! Before the patch, I got that in my container var/cache/dev/App_KernelDevDebugContainer.xml ```xml <tag>workflow<attribute name="name">article</attribute><attribute name="metadata"><attribute name="title">Manage article</attribute></attribute></tag> ``` After, I got ```xml <tag name="workflow"> <attribute name="name">article</attribute> <attribute name="metadata"> <attribute name="title">Manage article</attribute> </attribute> </tag> ``` Commits ------- 4a4b011 [DependencyInjection] fix XmlDumper when a tag contains also a 'name' property
This adds array attribute support for container service tags as described in #38339. The most notable change is the additions to the XML schema for services, because that's the current limitation for not using array.
This is reopening #38540 as new PR since the other one was ("accidentially") closed 😊
/cc @nicolas-grekas