-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[DIC] Added note on untrimmed parameters (XML) #2876
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
@@ -97,6 +97,21 @@ rather than being tied up and hidden with the service definition: | |||
->register('mailer', 'Mailer') | |||
->addArgument('%mailer.transport%'); | |||
|
|||
.. note:: |
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 prefer a caution directive
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.
Done :) .
Whoa, that's quick! 🚀 👍 |
This should be placed somewhere below, where we talk about constants as parameters |
@wouterj It is true for all parameters, not only for constants (it can hurt you for class names too for instance) |
Well, make it indeed easier to understand. What about taking the mailer example? Setting And after that, can you please squash your commits (if you know how to do that)? |
Done, I added the exact value of the retrieved parameter, so we can see the line returns and spaces, and I also added a note on constants and class names which can throw exceptions. |
trimmed. | ||
|
||
This means that the following configuration sample will have the value | ||
`\n sendmail\n`: |
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.
you must use double backticks
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.
Done, and squashed :)
In XML configuration, the value between` parameter` tags isn't trimmed, which can lead to unexpected behavior. See symfony/symfony#8661
👍 great note Loïc (and a clean PR)! I've patched this into the 2.2 branch at sha: 1b707dd Thanks! |
In XML configuration, the value between
parameter
tags isn't trimmed,which can lead to unexpected behavior.
See symfony/symfony#8661