Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Trim constants#8661
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Created a test for simple constant support in XML configuration files.
Added a fixture with an indented constant. This currently throws anexception:"""constant(): Couldn't find constant PHP_EOL"""This might be caused because the parameter value is not trimmed.
Fixed the exception throwed when indenting constants in XMLconfiguration files, by simply trimmed constants.
wouterj commentedAug 3, 2013
This is already proposed multiple times and refused. The reason (see#4463 ):
|
gnugat commentedAug 4, 2013
Then maybe the first commit, which adds a test for constant support, can still be useful? I'd be curious to see cases where whitespaces are used for constant names. |
wouterj commentedAug 4, 2013
Whitespaces for constant names are not common, but we can't make an exception for some values. See also#3646 |
gnugat commentedAug 4, 2013
@wouterj yes, I was looking at this PR, and also at its related issue#3644 and another PR#6123. While I still don't understand why this behavior should be kept, I think I'm going to take another approach: I'll submit a PR to add a test on constants support and another one on the component documentation. |
wouterj commentedAug 4, 2013
👍 for both of those PR you're going to create. I missed the test commit and we also don't have this documented. |
stof commentedAug 4, 2013
@gnugat People may want to define some parameters with whitespaces in it. If we are trimming the value, it becomes impossible |
This PR was squashed before being merged into the master branch (closes#8663).Discussion----------[DependencyInjection] Test constants| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | **yes**| License | MITAdded a test for constant support in XML configuration files.Related PR:#8661Commits-------9acedb7 [DependencyInjection] Test constants
In XML configuration, the value between` parameter` tags isn't trimmed,which can lead to unexpected behavior.Seesymfony/symfony#8661
When indenting constant parameters in XML configuration files, an exception is throwed.
This PR simply adds:
Example to reproduce the bug
Configuration sample:
Code sample:
Result:
Notice the fact that the error message is not: