-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Allow trimming service parameters value in XML configuration files #49412
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
src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd
Outdated
Show resolved
Hide resolved
1f2ea92
to
0bc9761
Compare
src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd
Outdated
Show resolved
Hide resolved
35ffcde
to
06b2f39
Compare
@@ -258,6 +258,7 @@ | |||
<xsd:attribute name="id" type="xsd:string" /> | |||
<xsd:attribute name="key" type="xsd:string" /> | |||
<xsd:attribute name="on-invalid" type="invalid_sequence" /> | |||
<xsd:attribute name="trim" type="boolean" /> |
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.
boolean
is a type that support both xsd:boolean
and DIC parameters as value. This trim
should not support DI parameters as it is a value used by the loader directly.
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.
depends whether DIC parameters work there or no.
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 tried and it doesn't work. I'll leave xsd:boolean
for exclude-self
as well 👍
06b2f39
to
aaf2313
Compare
…configuration files
aaf2313
to
bdc4c10
Compare
Thank you @alexandre-daubois. |
While coming across this documentation page, I learnt that strings as service parameters value aren't trimmed when using the XML multi-line style to define the value. I think adding the possibility of trimming the value if wanted could be a plus, allowing more flexibility when writing XML files.
Also, when using the
binary
parameter type,base64_decode
actually trims the string and allows to use the multi-line syntax. So we could see an added consistency here by allowing this with string parameters. 🙂